Click here to Skip to main content
15,867,453 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Help me on how to code in vb.net or vb 2008 that list all computer name on the wireless network or adhoc?
Posted
Updated 11-Oct-11 7:45am
v3

1 solution

Both problems are easy to solve.

This is your computer name:
VB
Dim machineName As String = System.Environment.MachineName


As to IP, what you can find is actually an array, as one machine can have more than one IP address. You need to use DNS:
VB
Dim strHostName As String = System.Net.Dns.GetHostName()
Dim ipEntry As System.Net.IPHostEntry = System.Net.Dns.GetHostEntry(strHostName)
Dim addr As System.Net.IPAddress() = ipEntry.AddressList


That's it!

[DISCLAIMER]
This answer was given in response to the version #1 of this question.

—SA
 
Share this answer
 
v5

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900