473,734 Members | 2,724 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

List the computers in the same network in C#

6 New Member
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 10233
Plater
7,872 Recognized Expert Expert
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?
Mar 10 '08 #2
jellychai
6 New Member
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#.

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 Recognized Expert Expert
What? What do you mean by "nodes" and "MIB" ? Is that something propriatary to your company?
Mar 11 '08 #4
jellychai
6 New Member
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 Recognized Expert Moderator Expert
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...e tc?

-Frinny
Mar 11 '08 #6
jellychai
6 New Member
What type of application are you creating?
Web Service, Web Application, Desktop Application...e tc?

-Frinny
Type of appliation that i do is windows application.
Mar 15 '08 #7
jellychai
6 New Member
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 Recognized Expert Expert
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
jellychai
6 New Member
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

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

Similar topics

10
6042
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 computers cannot access the database. The message is...
0
1981
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 directory. In windows xp "My Network Places -> Microsoft Windows Network" provides all machines that are present in the network. My need is something similar. Ned help Please. my email -- ioshadha@yahoo.co Thanks a lot OShadha.
3
3872
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
10517
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, so im sure it has room for improvement Assumptions: list of computers in C:\shutdownvbs\computers.txt
0
4478
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 String) 'Local Shares Try Dim scope As String = ("\\" & Machine & "\root\cimv2") Dim SharesClass As ManagementClass = New ManagementClass(scope, "Win32_Share", Nothing)
4
7694
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 want to be able to produce a list and work it from there. I found the following method: String path = "WinNT://MY.DOMAIN.COM"; String username = "administrator";
6
9845
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 thanks.
17
5566
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 in that chapter and create a socket connection between my desktop and laptop. However, these two computers are already connected on my home network (using the Windows Network Setup Wizard), so I was wondering if this will have any effect on what...
6
4206
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 recommended. If anyone has some suggestions, I'd love to give them a try - this is driving me nuts!! I am connected via wired-LAN to a Linksys WRT-600N router; there are 4 other computers on the network. The other 3 computers are working perfectly...
0
8946
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8776
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9449
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9310
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9236
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9182
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6735
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4809
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3261
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.