473,544 Members | 2,477 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Get all ip addresses of the computers connected to LAN

hi there!!!
very much newbie to socket progammin in .net. i've try the DNS class to
get the ip addresses but it always returns 1 ip that of my pc though i
got 50 PCs connected to the LAN. i tried everywhere so if anyone have
code for getting all the ip addresses of the PCs. plz copy paste here
so that i can try that out. Plz dont only give suggestions. put some
code. which can b helpful to me. i've already tried many suggestion.
plz dont mind but now i'm frustrate

Nov 16 '05 #1
4 9728
yyy
I'm really not sure - I know how to get a copmuter's external and
internal IP but never tried to get all IP's. Maybe this can help:
http://www.thecodeproject.com/csharp...asp#xx699928xx
Not sure though :oops:

*-----------------------*
Posted at:
www.GroupSrv.com
*-----------------------*
Nov 16 '05 #2
psg
"Lucky" <hi******@gmail .com> wrote in message
news:11******** **************@ z14g2000cwz.goo glegroups.com.. .
got 50 PCs connected to the LAN. i tried everywhere so if anyone have
code for getting all the ip addresses of the PCs


If You get Mask or Broadcast You may try to caclulate the whole range of
IP's that Yours computer belong to. Than if Bcast is not huge (ie. is
correctly configured) You may want to ping all the IPs and check if they are
alive.

Eg. Yours IP 192.168.1.20
Mask 255.255.255.192
then addresses in Your network are most probably in a range 192.168.1.0 -
192.168.1.63

RGDS PSG
Nov 16 '05 #3
On 30 Dec 2004 04:58:28 -0800, Lucky wrote:
hi there!!!
very much newbie to socket progammin in .net. i've try the DNS class to
get the ip addresses but it always returns 1 ip that of my pc though i
got 50 PCs connected to the LAN. i tried everywhere so if anyone have
code for getting all the ip addresses of the PCs. plz copy paste here
so that i can try that out. Plz dont only give suggestions. put some
code. which can b helpful to me. i've already tried many suggestion.
plz dont mind but now i'm frustrate


It going to be something like ARP, your own machine will have an ARP cache.
Look into the protocol and see if there's a broadcast that can be sent to
resolve all machines.
Nov 16 '05 #4
I cannot at this moment verify if this works, but I found this with a simple
google search using the keywords "csharp finding all computers network":

Link is here (watch for wordwrap):
http://groups.google.co.uk/groups?hl...TNGP12.phx.gbl

Text from that article:

[quote]
You can do this using ADSI in the System.Director yServices namespace. See
sample C# code below.

System.Director yServices.Direc toryEntry entryPC;
entryPC = new System.Director yServices.Direc toryEntry();
entryPC.Path = "WinNT://YourDomainname"
foreach(Directo ryEntry child in entryPC.Childre n)
{
if(child.Schema ClassName == CONST_COMPUTER)
MessageBox.Show (child.Name);

}
[end quote]

HTH.
Nov 16 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2217
by: Piotr - | last post by:
*** Sent via Developersdex http://www.developersdex.com ***
8
2687
by: Vanga Sasidhar | last post by:
I have four computers. One computer - Win XP Two computers - Win 98 One computer - Win ME I designed some pages in my computer having Win XP operating system. I installed dot net framework 1.1 and web matrix is used for asp .net code
1
1054
by: Scott Starker | last post by:
I have VB6 and XPHome. I have not tried to do this but I want to get a list of computers (connected with my computer) using the LAN cards (without using the Internet obviously). Is there a Component I should install? And if I may say, how do you do it? Any help would be appreciated. Scott
4
5129
by: tushar.n.patel | last post by:
hi there!!! very much newbie to socket progammin in .net. i've try the DNS class to get the ip addresses but it always returns 1 ip that of my pc though i got 50 PCs connected to the LAN. i tried everywhere so if anyone have code for getting all the ip addresses of the PCs. plz copy paste here so that i can try that out. Plz dont only give...
1
1762
by: Alain R. | last post by:
Hi, I would like to know how can i detect all computers connected to a particular network ? thanks a lot, A.
1
1737
by: premMS143 | last post by:
Hi Experts, We are having a network connection with Windows 2003 Server with Active Directory. Our network contaings 60 PCs. And I wanted to; Generate Popup/message at start up, say an example "Hi, today is XYZ birthday. His extension No. @@@" This should popup to all users whenever they start their system. Please help me.
1
4186
by: open raz | last post by:
Hi all, I am a python newbie. I am trying to query the network to see the ip address of the computers connected to my computer. I googled a lot but I could not find some simple methods for solving it. Any simple sample scripts and advices will be of great help to me to learn python. Thanking you.
0
7437
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...
0
7373
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...
0
7625
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. ...
0
7781
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...
1
7389
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...
0
7717
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...
0
4930
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3421
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
677
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.