473,385 Members | 2,003 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Changing IP-Addres and Default Gateway

Hi

In VB6 i changed the IP-Adress and Gateway of the computer by using API. Is
there an object available in .net for doing this?

Thanks alot

Nijazi Halimaji
Nov 21 '05 #1
2 5228
I haven't seen one. The easiest thing to do would be just expose your VB6
code as a COM class.

--
Jonathan Allen
"Nijazi Halimaji" <sp***@gmx.net> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hi

In VB6 i changed the IP-Adress and Gateway of the computer by using API.
Is there an object available in .net for doing this?

Thanks alot

Nijazi Halimaji

Nov 21 '05 #2
WMI is the way I would go, I haven't translated this to VB.NET, but it
should give you a start:

Function ChangeIpAddress(arrNewIPA, arrSubnetMask, arrGateway, strComputer)

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colNetAdapters = objWMIService.ExecQuery ("Select * from
Win32_NetworkAdapterConfiguration " & "where IPEnabled=TRUE")
strIPAddress = arrNewIPA
strSubnetMask = arrSubnetMask
strGateway = arrGateway
strGatewayMetric = Array(1)

For Each objNetAdapter in colNetAdapters
errEnable = objNetAdapter.EnableStatic(strIPAddress, strSubnetMask)
errGateways = objNetAdapter.SetGateways(strGateway, strGatewaymetric)
Next

End Function

"Nijazi Halimaji" <sp***@gmx.net> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hi

In VB6 i changed the IP-Adress and Gateway of the computer by using API.
Is there an object available in .net for doing this?

Thanks alot

Nijazi Halimaji

Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Kris | last post by:
Is it possible to change execution path in c++ without jumping to asm eg: int* arrayEncrypted int* arrayUnEncrypted after unencrypting from the encrypted to the unencrypted can I jump the...
1
by: steven virnig | last post by:
A server with SQL 2000 installed is moving to a new physical location. Our company standards mean that the name of the server and the IP address of the server will change also. This SQL instance...
0
by: Andrea Pagliano | last post by:
Hi, I am trying to develop a program that will allow me to store information like IP Address, DNS, subnet mask etc... in a profile and then use it and change the TCP/IP settings of the computer...
3
by: amisol | last post by:
I want to create a software that changes the network transport to the browser. It'll change the GET direction to something that i want. for example every surfing to google.com will redirect me to...
3
by: Bernd Giegerich | last post by:
Hi, we had a strange problem with DB2 8.2 Enterprise Edition on Windows 2003 (Standard) Server. We installed DB2 8.2 (8.1.7) directly on a naked W2K3 system (no migration, no update -> no...
0
by: James M via .NET 247 | last post by:
(I have 2x Front-end Web servers (Win2003 Ent IIS6.0), setup withNLB (single Affinity, also using SQLServer session state) thatare hosting a few .NET ASP web applications under the DefaultWebsite in...
3
by: cyberco | last post by:
I've posted this question in 'microsoft.public.dotnet.framework.compactframework' as well, but despite the great help I still haven't solved the problem. So before going the C++ route I would like...
4
by: talktozee | last post by:
Hey, everyone. I have a server that both hosts multiple websites AND sends mass emails for those multiple websites, but it does NOT receive email for those domains. Each website has both a...
1
by: anneaunimme | last post by:
I have a program which allow my computer to communicate to another device using an ethernet Cable. The thing is that this program is set so that it can only work through a specific IP address and a...
4
by: cleary1981 | last post by:
Hi, In the coming weeks we will be moving premises. I have installed new switches, patch panels and telephone system but I am worried about moving the server. In my mind I think it should be as...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.