This is another part of the program I was writing earlier. I usually work on this program either on my work machine or on my laptop. I have a database that has the same design on either machine and I keep it updated. I ran into the problem of having to go and change the connection string for my Datasets every single time that I would switch machines for testing. So instead of going through that I wanted to find a way to switch the connection string automatically. To that extend I wrote the following code.
Imports System.Net
Dim MachineIPList() As IPAddress>
Dim MachineHostName As StringDim MachineIP As IPAddressMachineHostName = DNS.GetHostName()MachineIPList = DNS.GetHostEntry(MachineHostName).AddressListFor Each MachineIP In MachineIPListControl.Text = MachineIP.ToString()Next