Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > Communications > How to Change IP,Default Mask,Gateway ?


Reply
 
Thread Tools Display Modes
  #1  
Old 10-10-2008, 04:25 PM
kresh7 kresh7 is offline
Regular
 
Join Date: Oct 2007
Posts: 84
Default How to Change IP,Default Mask,Gateway ?


Hi all i have a quetion how can i change the IP or default mask ,gateway,DNS Server IP of a Network Card in vb6 is there a class module or module i could use for this
Reply With Quote
  #2  
Old 10-13-2008, 07:02 AM
m0skit0's Avatar
m0skit0 m0skit0 is offline
Centurion
 
Join Date: Jul 2008
Location: Madrid (Spain)
Posts: 151
Default

You can use ipconfig.exe calling it throuhg the VB6 Shell() function. For DNS you must use nslookup.exe.
__________________
Use CODE wrappers and do not hurt my eyes!
Reply With Quote
  #3  
Old 10-13-2008, 04:35 PM
Roger_Wgnr's Avatar
Roger_Wgnr Roger_Wgnr is offline
CodeASaurus Hex

Forum Leader
* Expert *
 
Join Date: Jul 2006
Location: San Antonio TX
Posts: 2,427
Default

One method is documented at the MSDN website
http://www.msfn.org/board/lofiversio...hp/t70524.html
Another method would be to follow these steps (this is the method I used)
Quote:
Follow this steps :
1. Open registry on the HKEY_LOCAL_MACHINE
2. Find the subKey = SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkCards\"netcard# "
"netcard# " usually is "1" but you can control any subkey and find specific netwrok Adapters
Refer to "MSDN Registry Entries for Network Adapter Cards"
3. Get data for the value "ServiceName"
4. Find the subKey = SYSTEM\CurrentControlSet\Services\"ServiceName"\Parameters\TcpIp"
5. Set data for the value "IpAddress" to change IP address
6. Set data for the value "SubnetMask" to change subnet mask
7. Set data for the value "DefaultGateway" to change default gateway
8. Reboot your PC.
__________________
Code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. ~Martin Golding
The user is a peripheral that types when you issue a read request. ~Peter Williams
MSDN Visual Basic .NET General FAQ
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->