Visual Basic 2010 LAN IP's and Computer User Names
3 replies, posted
Okay, basicly the title explains it all. I've been trying multiple ways, but I just can't seem to get it working. I'm pretty new to VB 2010.
What I want to do is simply using
[code]Console.WriteLine("Computer Name: " + Something here + " IP Address: " + Something here)[/code]
I've got this code so far:
[code]Imports System.Net
Module Module1
Sub Main()
Dim d As Integer
Dim IPHEntry As IPHostEntry
Dim IPAdd() As IPAddress
Dim localHost As String
localHost = Dns.GetHostName()
IPHEntry = Dns.GetHostByName(localHost)
IPAdd = IPHEntry.AddressList
For d = 0 To IPAdd.GetUpperBound(0)
Console.Write("IP Address {0}: {1} ", d, IPAdd(d).ToString)
Next
Console.ReadLine()
End Sub
End Module[/code]
I found that part from the internet, but I don't know myself if it adds all the IP's from every single computer connected to the network or if it doen't.
Bump.
This should go in the Programming section
God damnit. I felt that this was the wrong section...
Let me just re-post it there.
Would be nice if the moderators could lock this.
Sorry, you need to Log In to post a reply to this thread.