Community discussion forum

Cannot Read IE Proxy settings using C# .NET 2.0 +

  • 3 months ago

    Hi All,

    I am currently trying to workout a solution for Reading IE Proxy settings in C#. I need to read all the option, automatically detect settings , Autoconfiguration url and manual proxy settings.

     1) I tried using Interop Services - WinHTTP.DLL, it did work, but I am supposed to use only C# stuff

    2) I tried reading registry fro the same, and was successful, but iam not supposed to use thsi solution.

    3) I tried using System.Net.Configuration, but the I cannot fetch the default System Proxy settings using the code :- //System.Net.Configuratiion System.Net.Configuration.ProxyElement proxyConf = new ProxyElement() ;

    proxyConf.UseSystemDefault = ProxyElement.UseSystemDefaultValues.True;

    if ( proxyConf.AutoDetect == ProxyElement.AutoDetectValues.True )

    Console.WriteLine("Auto detect Proxy");

    if (proxyConf.ScriptLocation != null)

     Console.WriteLine(" Auto Config Script");

     Console.WriteLine(proxyConf.ScriptLocation);

    }

    if (proxyConf.ProxyAddress != null)

    {

        Console.WriteLine(proxyConf.ProxyAddress);

    }

     

    It simply does not fetch the system settings for me.

    4) I tried System.Web.Configuration, but still no use.

    5) I cannot use Webbrowser control. How do I do it. Any help would be greatly appreciated

     Thanks

     

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).