Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Programmatically set TCIP address?

Status
Not open for further replies.

NoCoolHandle

Programmer
Apr 10, 2003
2,321
0
0
US
Does anyone know if it is possible to set the TCPIP with code, and or check it with code and if so... how (hints are ok/welcome)

TIA

Rob
 
Hi Rob

You said that you needed some hints, well i can tell you about how you can get the IP address from a locan or remote address, and after that you can get to your own question.

'To get a Web address
Dim Index As Integer
Dim IP As IPHostEntry =Dns.GetHostByName ("
Dim IP() AS IPAddress = IP.AddressList
For Index = 0 To IP.GetUpperBound(0)
Console.Write("IP Address {0}: {1} ", Index, IP(Index).ToString)
Next

'To get the Ip of your Local Machin, you get the address from the DNS.
Dim LocalHost As String
Dim Index As Integer
LocalHost = Dns.GetHostName()
Dim IP As IPHostEntry = Dns.GetHostByName(LocalHost)
Dim IP() As IPAddress = IP.AddressList
For Index = 0 To IP.GetUpperBound(0)
IpTextBox.Text("IP Address {0}: {1} ", Index, IP(Index).ToString)
Next

I hope that this help you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top