473,766 Members | 2,023 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 5268
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.ne t> wrote in message
news:%2******** ********@TK2MSF TNGP12.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("winm gmts:\\" & strComputer & "\root\cimv 2")
Set colNetAdapters = objWMIService.E xecQuery ("Select * from
Win32_NetworkAd apterConfigurat ion " & "where IPEnabled=TRUE" )
strIPAddress = arrNewIPA
strSubnetMask = arrSubnetMask
strGateway = arrGateway
strGatewayMetri c = Array(1)

For Each objNetAdapter in colNetAdapters
errEnable = objNetAdapter.E nableStatic(str IPAddress, strSubnetMask)
errGateways = objNetAdapter.S etGateways(strG ateway, strGatewaymetri c)
Next

End Function

"Nijazi Halimaji" <sp***@gmx.ne t> wrote in message
news:%2******** ********@TK2MSF TNGP12.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
3845
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 ip address to arrayUnEncrypted without resorting to assembly. currently doing it like this but it defeats the point of my exercise to use assembly
1
5015
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 name is the same as the server name. Will I have to uninstall and reinstall SQL Server (and recover the databases) when this move is made so that the instance name equals the server name? Is there a stored procedure that changes the instance...
0
298
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 based on the profile selected. I am a newbie so if yuo have some code example that would be nice! :-) Thank you!
3
1272
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 google.co.il. I want this to work for every browser. Any ideas? thanks.
3
3855
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 leftovers from an older version on the system). After that, we had to change the IP address of the system. Same
0
1524
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 IIS, and accessing via a Intranet LAN (this is notpublicly available). NETWEB1: NIC1 172.16.17.220 172.16.17.244 (NLB Virtual IP) NIC2 172.16.17.221 NETWEB2:
3
6993
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 to see if anybody in this group may have the answer. What I'm trying to do is change the route table of my Windows Mobile 5 Pocket PC (.Net CF) device (TyTN) using C#. This is probably similar as doing it on standard CF. Using Iphlpapi.dll I...
4
6364
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 public and private IP, which are bound to the NIC. When I send out my mass emails, I would like it so that the "Received: from" lines in the message header reflects the domain and public IP that the email is sent from. However, everything I've read...
1
2361
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 specific port number. Let's say : IP address : 192.234.1.101 Port Number: 5555 When I connect the cable between the computer and the device, the connection is recognized as a "Local Area Connection" but when I try to run the program I have an...
4
1816
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 simple as just lifting it and plugging it into the new network. Is there anything I am missing? Some users have VPN connections I would imagine these are going to have to be reconfigured.
0
10168
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10008
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9959
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9837
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7381
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5423
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3929
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3532
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2806
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.