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.
List the computers in the same network in C#
Collapse
X
-
What?
Getting the IP address of the current computer is pretty simple. There is like a System.Net.Netw orkInformation. NetworkInterfac e 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#.Originally posted by PlaterWhat?
Getting the IP address of the current computer is pretty simple. There is like a System.Net.Netw orkInformation. NetworkInterfac e 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?
This is the part of my coding that use to open the connection between manager and the agent:
[code=cpp]
private void ButtonOpen_Clic k(object sender, System.EventArg s e)
{
Cursor.Current = Cursors.WaitCur sor;
objSnmpManager. ProtocolVersion = ComboVersion.Se lectedIndex + 1;
objSnmpManager. LogFile = TextLogFile.Tex t;
objSnmpManager. Open(TextAgent. Text, TextCommunity.T ext, Int16.Parse(Tex tPort.Text));
if (GetResult() == 0)
{
bOpened = true;
EnableControls( );
}
Cursor.Current = Cursors.Default ;
}[/code]
Thanks for your help.Comment
-
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.Originally posted by PlaterWhat? What do you mean by "nodes" and "MIB" ? Is that something propriatary to your company?Comment
-
What type of application are you creating?Originally posted by jellychaiThe 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.
Web Service, Web Application, Desktop Application...e tc?
-FrinnyComment
-
List the computers in the same network in C#
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 ChaiComment
-
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.Comment
-
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?Originally posted by PlaterUnless 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.
Thank you.Comment
-
Have you looked into LDAP ?
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.
MODERATORComment
Comment