Reading proxy setting from windows service RRS feed

  • Question

  • Hi,

    I have written code that does some work by invoking URLs. I am using WebClient class to invoke the urls. This code runs as a windows service under LocalSystem user. As the code is running behind proxy I am unable to invoke the urls. I understand that LocalSystem user does not have any proxy configured.

    Is there a way I can make the .NET framework read the proxy settings configured in IE of another user. Or can I manually read the proxy setting through some code and set it. Are there any examples for this.

    Is there any other way I can make this code work.

    Friday, January 9, 2009 3:07 PM

All replies

  • Hi!

    Answered here:http://social.microsoft.com/Forums/en-US/netfxnetcom/thread/f182fa7f-32d4-4d69-a431-6fbb66504afe

    Lucian Baciu, http://studentclub.ro/lucians_weblog
    Friday, January 9, 2009 8:01 PM
  • Hi,

    Thanks for pointing. But again this is reading the registry values for CURRENT_USER which in my case is LocalSystem and this does not have any proxy settings configured.

    Is my understanding correct.

    Saturday, January 10, 2009 1:37 PM


    How about this blog article to load the Internet Explorer proxy settings?  

    I have tested it in a Windows service running on LocalSystem account and I got the result.  

    Is this what you are achieving?   Besides, could you please tell me what your conern is to read or set the IE proxy settings from a LocalSystem Windows service?  


    Best Regards,

    Please remember to mark the replies as answers if they help and unmark them if they provide no help. http://forums.msdn.microsoft.com/en-US/csharpide/thread/8e9ed0d7-11ff-402a-8489-9b5f05eeb706 http://forums.msdn.microsoft.com/en-US/vssetup/thread/60424309-bd78-4ca2-b618-03c4a16123b6
    Wednesday, January 14, 2009 3:46 AM
  • Hi Lingzhi,

    Did you use the unmanaged call to WinHttpGetProxyForUrl function. I have not tried that. What if the proxy server requires username and password?
    My requirement is to just read the default IE proxy settings and use it to invoke some external urls. Can you please help me with some code example.

    Monday, January 19, 2009 9:57 AM