Click here to Skip to main content
15,886,919 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
Hi all,
does anybody knows how to change the Ip address programatically in c#?
Posted

Why do you need to change IP address ?

In case you are connected your IP address change will actually release all the connections. Does it makes any sense ?

Anyway to do this you can use Registry hacks :

http://www.codeguru.com/cpp/i-n/network/networkinformation/article.php/c2473[^]

Or you might also take a look into Configuring TCP/IP Settings using WMI and C#[^]

I hope this will help you.
 
Share this answer
 
Which one?
Your PC IP address? AFAIK you can't do it in a flexible manner, you have to talk to your router (or other DCHP server) and there is no standard way of doing that I am aware of.

Your internet IP address? Depends: if it is a static IP than you can't. If it is dynamic then the easiest way is reset the router, and hope your ISP issues you a new address. Make sure you are the only user though as you would annoy the crap out of me if you did that while I was busy...

Why do you want to?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900