none
Change Host IP address, Subnet mask and Gateway settings using c# application...

    Question

  • Hi... 

        I have to prepare a C# application. Which will detect the proxy settings of the PC & allow user to modify it.    
        How i can change the proxy settings of the PC using C# application...?


        Any document or sample code will help me to get going...


    Thanks in advance,
    IamHuM
    • Edited by IamHuM Monday, December 22, 2008 6:00 AM
    Friday, December 19, 2008 2:01 PM

Answers

  • Hi IamHuM,

    Yes, you can use WMI to configure "TCP/IP Properties" Setting(including the IP Address, Subnet Mask, and Default Gateway) programmatically using C#.

    Here is an sample project to list your existing TCP/IP setting information and reconfigure these information. Please refer to Configuring TCP/IP Settings using WMI and C#.

    Note: when using the sample project, you need to add a reference to System.Management.dll.

    Please have a try.

    Best regards,
    Guo

    • Marked as answer by Guo Surfer Friday, December 26, 2008 12:24 PM
    Thursday, December 25, 2008 7:40 AM

All replies

  • There are no proxy settings of a PC. Every browser may have it's own settings. Check all the browsers your users may use and search by their respective forums/home pages.
    This is not a C# question.
    Please remember to mark the replies as answers if they answered your question :)
    Friday, December 19, 2008 3:40 PM
  • Hi...

        Sorry but my question is different. I entered it wrongly. My apology for the same.

        Here is what i want actually.

        I am retriving my system IP address, subnet mask and Gateway usng my C# application. And I want to change the IP address, Sub-Net mask and Gateway value of my PC using C# application. 
        How i can do this...? What are the values we can change programatically...?


    Thanks in advance,
    IamHuM
    Monday, December 22, 2008 5:59 AM
  • Hi IamHuM,

    Yes, you can use WMI to configure "TCP/IP Properties" Setting(including the IP Address, Subnet Mask, and Default Gateway) programmatically using C#.

    Here is an sample project to list your existing TCP/IP setting information and reconfigure these information. Please refer to Configuring TCP/IP Settings using WMI and C#.

    Note: when using the sample project, you need to add a reference to System.Management.dll.

    Please have a try.

    Best regards,
    Guo

    • Marked as answer by Guo Surfer Friday, December 26, 2008 12:24 PM
    Thursday, December 25, 2008 7:40 AM
  • Hi Guo....

        Thanks for your reply...

        One more doubt i have is... Can i change these settings even though i am not an administrator o that system...?

        Is it possible in .Net...


        Thanks once again for your reply...

    Regards,
    IamHuM
    Monday, December 29, 2008 1:27 PM