Microsoft Developer Network > Forenhomepage > Visual C# General > How to adjust TCP/IP settings (IP, DNS, etc)
Stellen Sie eine FrageStellen Sie eine Frage
 

BeantwortetHow to adjust TCP/IP settings (IP, DNS, etc)

  • Freitag, 9. Juni 2006 15:20mrayyan TeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillen
     
    Greetings,
    I am trying to find out how to change the DNS from "Obtain DNS server address automatically" to manual and enter the DNS address.

    Basically, what I want is the following:
    1. If computer ip address subnet is NOT  "141.218.255.255" then change the DNS setting to "Obtain DNS server address autoamtically". 

    2. and if it is "141.218.255.255" then make the DNS primary address "141.218.1.92" and secondary "141.218.218.96"

    Is there away to do this using System.Net?

Antworten

  • Freitag, 9. Juni 2006 15:41Brendan GrantModeratorTeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillen
     Beantwortet

    Unfortunately this kind of functionality is still not supported by the framework... instead one very easy way to do such things is to pass the necessary arguments to an internally launched instance of netsh.

    When it comes to determining the current networks state however, if you are running the 2.0 Framework I would suggest looking into the NetworkInfromation namespace and all of the gettable properties it provides.

Alle Antworten

  • Freitag, 9. Juni 2006 15:41Brendan GrantModeratorTeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillen
     Beantwortet

    Unfortunately this kind of functionality is still not supported by the framework... instead one very easy way to do such things is to pass the necessary arguments to an internally launched instance of netsh.

    When it comes to determining the current networks state however, if you are running the 2.0 Framework I would suggest looking into the NetworkInfromation namespace and all of the gettable properties it provides.