.LocalIP Update (1 Viewer)

Kn1ght_M4r3

Member
Joined
Mar 3, 2003
Messages
332
Location
D o w n l o a d C o m p l e t e .....
Hey there i just have one small problem, i want to show the winsock local Ip. Like it works but only thing is when the Local Ip changes it does not change within the program does anyone know why? :confused:

example
im on a network and it will display the network IP which is correct. But when i close the netowrk connection and try to update it, nothing changes.

textbox code is like this:

Private Sub Command1_Click()
text1 = Winsock.LocalIP
End Sub

any help would be greatly appreciated. :D
 

sunny

meh.
Joined
Jul 7, 2002
Messages
5,350
Gender
Male
HSC
2002
What do you mean by "close the connection"? What sort of network are you running and how are is the IP on the machine configured?
 

Kn1ght_M4r3

Member
Joined
Mar 3, 2003
Messages
332
Location
D o w n l o a d C o m p l e t e .....
Um only 2 comp network. Running XP and yeah you have the network IP of 127.0.0.1 when there is no computer connected [turned off]

so when i turn on the both computers the network is up and running right. Ip of eg: 192.124.12.23
Then when i turn off one computer the IP should become 127.0.0.1 but it doesn't it stays the same as 192.124.12.23
 

sunny

meh.
Joined
Jul 7, 2002
Messages
5,350
Gender
Male
HSC
2002
Not that surprising since its the Winsock control :p. After so many versions it still has some quirks and bugs about it.

It'll either take a while before Winsock realises the IP has changed or it won't change at all. I would suggest using the Winsock API instead of the control.
 

sunny

meh.
Joined
Jul 7, 2002
Messages
5,350
Gender
Male
HSC
2002
Using the Winsock API is alot of pretty hard work :( and its quite low level as far as VB is concerned so it'll take a while to explain. Try this tutorial and see if it helps you.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top