473,322 Members | 1,347 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

List the computers in the same network in C#

I'm doing the final year project that related to the SNMP. I need to find the solution for the IP auto detection in C#. When I run the main project, the program can automatically detect the IP for the agent and retrieve it's MIB, so that the user do not need to enter the IP address of the agent. Beside that, I also look for the solution that can detect the nodes that had switch on or switch off in C# coding. Wish can get the solution for these two problems. Thank you.
Mar 10 '08 #1
11 10163
Plater
7,872 Expert 4TB
What?
Getting the IP address of the current computer is pretty simple. There is like a System.Net.NetworkInformation.NetworkInterface class that handles that for you.
Note: It does not necessarily give you the "outside" IP depending on your network configuration.

So what are you ACTUALLY after?
Mar 10 '08 #2
What?
Getting the IP address of the current computer is pretty simple. There is like a System.Net.NetworkInformation.NetworkInterface class that handles that for you.
Note: It does not necessarily give you the "outside" IP depending on your network configuration.

So what are you ACTUALLY after?
I know to get the local IP (127.0.0.1), but what I means here is that the IP for the nodes those connect to my manager, I need to retrieve their MIB without enter their IP. I do not know the coding for it in the C#.

This is the part of my coding that use to open the connection between manager and the agent:
Expand|Select|Wrap|Line Numbers
  1. private void ButtonOpen_Click(object sender, System.EventArgs e)
  2.         {
  3.             Cursor.Current = Cursors.WaitCursor;
  4.             objSnmpManager.ProtocolVersion = ComboVersion.SelectedIndex + 1;
  5.             objSnmpManager.LogFile = TextLogFile.Text;
  6.  
  7.             objSnmpManager.Open(TextAgent.Text, TextCommunity.Text, Int16.Parse(TextPort.Text));
  8.  
  9.             if (GetResult() == 0)
  10.             {
  11.                 bOpened = true;
  12.                 EnableControls();
  13.             }
  14.  
  15.             Cursor.Current = Cursors.Default;
  16.         }
Thanks for your help.
Mar 10 '08 #3
Plater
7,872 Expert 4TB
What? What do you mean by "nodes" and "MIB" ? Is that something propriatary to your company?
Mar 11 '08 #4
What? What do you mean by "nodes" and "MIB" ? Is that something propriatary to your company?
The nodes that i means is the laptops those connect to my SNMP manager. MIB is the management information base. I still the student, this just my final year project, i just want to find solution to automatically detect IP, i do not want to enter the IP address manually.
Mar 11 '08 #5
Frinavale
9,735 Expert Mod 8TB
The nodes that i means is the laptops those connect to my SNMP manager. MIB is the management information base. I still the student, this just my final year project, i just want to find solution to automatically detect IP, i do not want to enter the IP address manually.
What type of application are you creating?
Web Service, Web Application, Desktop Application...etc?

-Frinny
Mar 11 '08 #6
What type of application are you creating?
Web Service, Web Application, Desktop Application...etc?

-Frinny
Type of appliation that i do is windows application.
Mar 15 '08 #7
I need to find the solution to list out all the computers in same local network. Such as i have 4 computers in my local network, I need to list out all the IP address for these 4 computers by using C# coding. Have everyone can help me?

Thank you.

Best Regard,
Jelly Chai
Mar 20 '08 #8
Plater
7,872 Expert 4TB
Unless you have a domain controller (or just a good active directory?)
I think you need to rely on netbios (command prompt: NET VIEW) or equivilants.
Then you can do a dns request for those names agaisnt your system.

WMI might be a good choice for getting all this information.
Mar 20 '08 #9
Unless you have a domain controller (or just a good active directory?)
I think you need to rely on netbios (command prompt: NET VIEW) or equivilants.
Then you can do a dns request for those names agaisnt your system.

WMI might be a good choice for getting all this information.
I do not understand what you means? I just need to list out all the computers that connected to my master computer which are in the same network. I need to know those computers by using C# coding, because it will used for my SNMP program. Can you teach me how to write the coding for it?

Thank you.
Mar 20 '08 #10
Plater
7,872 Expert 4TB
So there is a domain controller? LDAP should work then
Mar 20 '08 #11
Plater
7,872 Expert 4TB
Have you looked into LDAP ?
http://www.nikhedonia.com/notebook/e...-domain-via-c/


I have merged these two threads, please do not double post. If the future if you wish to clarify your initial question, please post the clarification in the same thread.
MODERATOR
Mar 20 '08 #12

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: MHenry | last post by:
Hi, We were going merrily along for 6 years using this database to record all client checks that came into our office, including information about what the checks were for. Suddenly, network...
0
by: Oshadha | last post by:
Hi All I'm trying to query and get a list of all reachable computers in a network. I also heard that you can query active directory and find domain pc list. but my need is not to query active...
3
by: Steve | last post by:
Hi all How would i get a list of all Active Computers on a network? All I need are the computer names. Kind Regards, Steve.
3
by: newsgroups.jd | last post by:
Im sure there is a better way to do this - just posting what I did to get it to work. Please feel free to comment with suggestions - this was my first vb.net program and I am not a programmer,...
0
by: NoWhereMan | last post by:
Hello, I'm trying to get the list of shared folders of a network computer and add them to a combo box. I'm using the bellow code in VB .NET. Code ==== Private Sub EnumShares(ByVal Machine As...
4
by: JB | last post by:
I am trying to get a list of all the active computers running on my domain. I'm writing some remote management style software with WMI, which works fine when i know the computer name, but i just...
6
by: kimiraikkonen | last post by:
Hello, I've been working on a project and i wonder how to get list of the LAN computer names in a tree list which are involved under the same workgroup name? What can be the code be? Very...
17
by: John Salerno | last post by:
Let me see if this question even makes sense...I'm reading Core Python Programming and I jumped ahead to the more specific topics like network programming. I plan to follow along with the example...
6
by: belias | last post by:
So...here we go. I'm having an issue with one computer on a network not being able to ping other computers by name. I've spent the last day searching similar issues and I've tried all the steps...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.