Click here to Skip to main content
15,918,976 members
Home / Discussions / C#
   

C#

 
GeneralRe: Sending info to command line Pin
Dustin Metzgar15-Jun-06 9:05
Dustin Metzgar15-Jun-06 9:05 
AnswerRe: Sending info to command line Pin
Eric Dahlvang15-Jun-06 10:14
Eric Dahlvang15-Jun-06 10:14 
GeneralRe: Sending info to command line Pin
ddpn4215-Jun-06 10:53
ddpn4215-Jun-06 10:53 
AnswerRe: Sending info to command line [modified] Pin
Eric Dahlvang15-Jun-06 11:16
Eric Dahlvang15-Jun-06 11:16 
GeneralRe: Sending info to command line [modified] Pin
ddpn4216-Jun-06 4:31
ddpn4216-Jun-06 4:31 
QuestionCLR Integration. Pin
PrashantJ15-Jun-06 8:26
PrashantJ15-Jun-06 8:26 
AnswerRe: CLR Integration. Pin
Josh Smith15-Jun-06 8:33
Josh Smith15-Jun-06 8:33 
QuestionPanel contrrol are not removing correctly Pin
Ista15-Jun-06 7:39
Ista15-Jun-06 7:39 
AnswerRe: Panel contrrol are not removing correctly Pin
Josh Smith15-Jun-06 8:03
Josh Smith15-Jun-06 8:03 
GeneralRe: Panel contrrol are not removing correctly Pin
Ista15-Jun-06 8:57
Ista15-Jun-06 8:57 
QuestionSerialPort class and opening ports Pin
Member 76109415-Jun-06 6:07
Member 76109415-Jun-06 6:07 
Questionpreventing header in xml file Pin
Yustme15-Jun-06 6:01
Yustme15-Jun-06 6:01 
AnswerRe: preventing header in xml file Pin
Dustin Metzgar15-Jun-06 6:19
Dustin Metzgar15-Jun-06 6:19 
GeneralRe: preventing header in xml file Pin
Dustin Metzgar15-Jun-06 6:34
Dustin Metzgar15-Jun-06 6:34 
GeneralRe: preventing header in xml file Pin
Yustme15-Jun-06 6:55
Yustme15-Jun-06 6:55 
GeneralRe: preventing header in xml file Pin
Dustin Metzgar15-Jun-06 6:59
Dustin Metzgar15-Jun-06 6:59 
GeneralRe: preventing header in xml file Pin
Yustme15-Jun-06 8:10
Yustme15-Jun-06 8:10 
GeneralRe: preventing header in xml file Pin
Dustin Metzgar15-Jun-06 8:28
Dustin Metzgar15-Jun-06 8:28 
GeneralRe: preventing header in xml file Pin
Yustme15-Jun-06 8:43
Yustme15-Jun-06 8:43 
GeneralRe: preventing header in xml file Pin
Dustin Metzgar15-Jun-06 8:59
Dustin Metzgar15-Jun-06 8:59 
GeneralRe: preventing header in xml file Pin
Yustme15-Jun-06 9:17
Yustme15-Jun-06 9:17 
QuestionEnumerating All computers on the Lan Pin
wasife15-Jun-06 5:40
wasife15-Jun-06 5:40 
AnswerRe: Enumerating All computers on the Lan Pin
Josh Smith15-Jun-06 5:47
Josh Smith15-Jun-06 5:47 
AnswerRe: Enumerating All computers on the Lan Pin
Alexander Wiseman15-Jun-06 6:11
Alexander Wiseman15-Jun-06 6:11 
I think what Josh said is good advice.

There is another way to attack the problem, if you're interested. You could send out ARP (Address Resolution Protocol) requests to IPs on the whole network and see what responses you get. An ARP request is broadcasted to the whole network and it basically asks the question: "Who has IP address www.xxx.yyyy.zzz?". Each device on the network looks for such packets and will reply to the sender with its MAC address, which then allows the sender to associate an IP Address with a MAC address so that it knows how to get packets to that device.

For example, let us say that you are on a computer whose IP address on the LAN is 192.168.2.33. You want to know what other computers are out there, specifically on the subnet 192.168.2.x. Let us further say that there are three more machines on that subnet: 192.168.2.50, 192.168.2.67, and 192.168.2.4. Your computer sends out a whole slew of ARP requests, like this (this is what it might look like in a packet sniffer):
From: 192.168.2.33 BROADCAST --> who has 192.168.2.1 ?
From: 192.168.2.33 BROADCAST --> who has 192.168.2.2 ?
From: 192.168.2.33 BROADCAST --> who has 192.168.2.3 ?
From: 192.168.2.33 BROADCAST --> who has 192.168.2.4 ?
....
From: 192.168.2.33 BROADCAST --> who has 192.168.2.255 ?
Now when those three machines see their addresses asked for, they reply to your computer like so:
From: 192.168.2.50, To: 192.168.2.33 --> 192.168.2.50 is at [some MAC Address]
From: 192.168.2.67, To: 192.168.2.33 --> 192.168.2.67 is at [some MAC Address]
From: 192.168.2.4, To: 192.168.2.33 --> 192.168.2.4 is at [some MAC Address]
Now, when your computer picks those messages up, it knows how many computers are on the subnet 192.168.2.x and what their IP addresses are. From there to getting the computer names would not be hard.

This is just another idea, if you want a more low-level method of solving the problem. In order to send and receive packets from your application, doing a quick article search on CodeProject for "sending packets" or "receiving packets" should pull back some helpful results.

I hope this gives you some ideas; doubtless there are other ways of doing it, and perhaps more efficient than this one.

Sincerely,
Alexander Wiseman
GeneralRe: Enumerating All computers on the Lan Pin
Josh Smith15-Jun-06 7:58
Josh Smith15-Jun-06 7:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.