Click to See Complete Forum and Search --> : Browse computer on network


coolsun20
April 25th, 2006, 09:22 PM
I am designing a small application which has a browse button, when clicked it should display all the computers(terminals) on a network in a listbox or grid or it should show commondialog from whereI could select a terminal and do further processing. Is there any api call which I could use to get list of all the terminals along with their ipaddresses and name that I could access from my machine ..

Any help or direction would be appreciated..



Thanks in advance...

poojapatel
April 26th, 2006, 01:00 AM
Hi,

To enumerate the Network you need to use WNETXXXXXX API's.

the APIs required in your case are :

WNetOpenEnum
WNetEnumResource

you need to call it recursively for each domain and for each domain you need to call WNetEnumResource in while loop....

See the documentation in MSDN and there the Clear and simple example is given.

check : http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wnet/wnet/enumerating_network_resources.asp

and after getting Name of all the computers in network you can use winsock API to get IP address. for that use GetAddrbyHostname Api.

reply if you get your problem solved. feel free to ask for any doubt. I had alredy created the same before 1yr.

coolsun20
April 26th, 2006, 09:47 PM
Perfect answer thanks for your help !!! got problem solved