Microsoft Developer Network > Página Inicial dos Fóruns > Visual C# General > How to adjust TCP/IP settings (IP, DNS, etc)
Fazer uma PerguntaFazer uma Pergunta
 

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

  • sexta-feira, 9 de junho de 2006 15:20mrayyan Medalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     
    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?

Respostas

  • sexta-feira, 9 de junho de 2006 15:41Brendan GrantModeradorMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     Respondido

    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.

Todas as Respostas

  • sexta-feira, 9 de junho de 2006 15:41Brendan GrantModeradorMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     Respondido

    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.