Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#
select "Obtain DNS Server addresses automatically" in Local Area Connection...
 

http://upcity.ir/images/83069313380920944438.png[^]
Posted 16-Jan-13 3:56am

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

You can use WMI for that. See this article for general interface settings manipulation: Configuring TCP/IP Settings using WMI and C#[^]. Use EnableDHCP[^] method.
 
[update]
If you don't want to write such "complicated" code, you can also call NETSH. See: http://visibleprocrastinations.wordpress.com/2007/04/20/using-netsh-to-change-between-dhcp-and-static-ips/[^]
  Permalink  
v2
Comments
samadblaj at 16-Jan-13 10:08am
   
do not using?
Zoltán Zörgő at 16-Jan-13 12:42pm
   
why not?
Zoltán Zörgő at 16-Jan-13 12:56pm
   
you can use netsh also. see update.

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



Advertise | Privacy | Mobile
Web04 | 2.8.140709.1 | Last Updated 16 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid