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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Checking for IP Addresses, WINS & DNS Servers 1

Status
Not open for further replies.

damann

Technical User
Jul 19, 2000
114
0
0
US
Hey all,


I was wondering if anyone can shed some light on how to go about finding out what the IP Address, WINS and/or DNS server is for a machine that my app is running on? I've never done any network type programming in VB6 and would love it if someone can help me out with this one...


Thanks,
Damann
 
One to get the IP address is to drop a winsock control onto a form, Then use the .LocalIp property

Debug.Print Winsock1.LocalIP

Thanks and Good Luck!

zemp
 
Thanks a lot.... This was helpfull. Now, is there some other type of control that would go out and check the other information like DNS and/or a WINS server?



Thanks,
Damann
 
Sorry, I must of hit submit before I finished. Unfortunaltly I haven't done much network programming either. Can't help with the others. I am sure someone else will pick up the slack.

In the mean time check out the following threads. They may be helpful.

thread222-214245
thread222-21472

Thanks and Good Luck!

zemp
 
Try this, first go to this website and download this the OCX file for DNS, this component is not part of Visual basic and must be downloaded: once downloaded and installed, open a new form, add the DNS component, by selecting Projects and then the Components Option. Then add two command buttons cmdIP and cmdDNS
two text boxes txtIP and txtName. add the following to the cmdIP command button:
txtIP.Text = DNS1.NameToAddress(txtName.Text)
txtName.Text = DNS1.AddressToName(txtIP.Text)
then add this line to the cmdDNS button:
txtName.Text = DNS1.AddressToName(txtIP.Text)
Once completed start the application, click the cmdIP button and it will give you both the IP and DNS name. If you know an IP address inter it in the txtIP text box and click the cmdDNS button to see the DNS for that IP. To see the IP for a DNS, enter the DNS in the txtName text box and click the cmdIP button for the IP address. Hope this helps.
 
I have used a bunch of code from here and I think you will find everything you need here:
More information about network stuff than you will come up with a use for...all in easy to use cut-and-paste format...and nothing to download.

Hope that helps!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top