How to find connected pcs in LAN?

I want to find the ip addresses of connected pcs.(in fact only one,that is the server),and connected to them automatically through programming.
use what API?

http://docs.unity3d.com/Documentation/ScriptReference/Network-connections.html

If you want to discover servers on the same LAN then the best way without using some online fixed ip authorative server is for you to create a UDP server socket on the server which listens to a specific port address for “discover” messages and when it gets a message it will return a reply to the sender of the discover message.

On the client side you would have to make a “discover” UDP message that you broadcast onto the network using the specific port you used on the server and then wait for a reply. If/When you receive a reply you can extract the server address from the message. You might have to send the client UDP message more than once as UDP is unreliable (usually it will get through the first time in my experience).

PS. the broadcast IP address is 255.255.255.255 or just the xxx.xxx.xxx.255 where the x’es is the local area address range e.g. 192.168.0.255 for many LAN’s.

You are both awesome.good idea…I am still feel unfamiliar with net