title: Change IP address, subnet mask, dns servers and default gateway in C#
body: <p>I am VERY new to C#.  I want to create a small console app that sets the following:</p>
  
  <pre><code>IP address: 192.168.10.133
  Subnet mask: 255.255.255.0
  Default gateway: 192.168.10.66
  Preferred DNS server: 192.168.10.3
  Alternate DNS server: 192.168.10.5
  </code></pre>
  
  <p>and another small app that clears that information and sets <code>"Obtain an IP address automatically"</code> and <code>"Obtain DNS server address automatically"</code>.</p>
  
  <p>I've found some examples of scripts that people have posted on this forum and other forums, but I can't get them to work.</p>
  
  <p>It might be a lot to ask, but I would appreciate if someone could post something here that will help me.</p>
  
  <p>I really appreciate it!</p>