|
-
Feb 12th, 2007, 06:20 AM
#1
PowerPoster
Re: Changing IP address with VB
Hi, both examples i posted change only the IP, Subnet, and Gateway.
DNS is just an optional item in both of them.
If you arent going to know the Adapter name, which I doubt you will if you are giving this to other people, then use the WMI one (1st one), for now at least. All you need is the one line inside the Command1_Click sub.
SetStaticIp "192.168.0.2", "255.255.255.0", "192.168.0.1"
The other 2 subs can go either in the same form or in a seperate module, doesnt matter. You can get the return string from the function by assigning it to a string variable, such as in the example. Or just set it like above.
If you look at the attachment in the WMI post, you will also see there is more code for getting the IP information etc.
However, typically you must also set the DNS info when using a Static IP or you wont get online.
Last edited by rory; Feb 12th, 2007 at 06:26 AM.
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
|