|
-
Mar 11th, 2006, 04:30 PM
#1
Thread Starter
Lively Member
Display the IP of the system
I want to Display the IP of the system in which a program of mine is running. How do I do this using VB ... please somebody help .. ?
-
Mar 12th, 2006, 08:23 AM
#2
New Member
Re: Display the IP of the system
You can do this by using winsock. First add winsock to your project: ctrl+t and select winsock control 6.0. Put winsock in your form and add this code:
Private Sub Command1_Click()
MsgBox Winsock1.LocalIP
End Sub
-
Mar 12th, 2006, 09:39 AM
#3
Junior Member
Re: Display the IP of the system
Yeah but the user could be behind a router in which case it would just display 192.168.1.3 or alike. What you could do is create a PHP file with this in it...
PHP Code:
<?php print('IP:<b> '. $_SERVER['REMOTE_ADDR'] .'</b>') ?>
Then use an Inet Control to get that page source and split it!
-
Mar 12th, 2006, 06:00 PM
#4
Re: Display the IP of the system
you could do that as Winsocket said but, if you run your app on different network machines then the IP will be identical everytime, this is because the IP which you get from Winsockets example is not the true IP of the computer, its the internet IP address of the router access point
-
Mar 12th, 2006, 06:11 PM
#5
Re: Display the IP of the system
Which is actually the true IP of the computer It simply may be shared across multiple computers within the network via NAT. For all intents and purposes you don't need to know that.
-
Mar 12th, 2006, 10:14 PM
#6
Re: Display the IP of the system
 Originally Posted by penagate
Which is actually the true IP of the computer  It simply may be shared across multiple computers within the network via NAT. For all intents and purposes you don't need to know that.
technically its not the true IP, as the true IP will be the network computer, an IP is used to identify an individual, you cant connect to a network terminal via your router internet IP, only the true terminal IP
-
Mar 13th, 2006, 01:22 PM
#7
Thread Starter
Lively Member
Re: Display the IP of the system
bingo.... I have got it... Thanks everybody for your help...
-
Mar 13th, 2006, 08:14 PM
#8
Junior Member
Re: Display the IP of the system
My i ask what your final code turned out like?
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
|