Click here to Skip to main content
12,696,493 members (29,030 online)
Rate this:
Please Sign up or sign in to vote.
See more: C#
select "Obtain DNS Server addresses automatically" in Local Area Connection...[^]
Posted 16-Jan-13 4:56am

1 solution

Rate this: bad
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.

If you don't want to write such "complicated" code, you can also call NETSH. See:[^]
samadblaj 16-Jan-13 10:08am
do not using?
Zoltán Zörgő 16-Jan-13 12:42pm
why not?
Zoltán Zörgő 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)

  Print Answers RSS
Top Experts
Last 24hrsThis month

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

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100