|
-
September 13th, 2001, 02:53 PM
#1
Refreshing winsock details
Hi,
I'm successfully using winsock in a small/simple application to get ip details and computer name. However, should the ip details change whilst the application is open, and I try to get the details again, the original ip is given instead of the new ip details. The following is the code I'm using (as you can see, small/simple!)
Is there any code I can add to refresh the ip details?
Thanks in advance.
private Sub Command1_Click()
Call GetDetails
End Sub
private Sub Command2_Click()
Unload me
End Sub
private Function GetDetails()
Text1.Text = Winsock1.LocalIP
Text2.Text = Winsock1.LocalHostName
End Function
-
September 13th, 2001, 04:24 PM
#2
Re: Refreshing winsock details
Try this
private Function GetDetails()
Winsock1.Close
Winsock1.Bind
Text1.Text = Winsock1.LocalIP
Text2.Text = Winsock1.LocalHostName
End Function
Tom Cannaerts
[email protected]
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|