locked
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.

    Thanks,
    Jagannath
    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

    Regards,
    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.

    Thanks,
    Jagannath
    Saturday, January 10, 2009 1:37 PM
  •  

    Hello,

    How about this blog article to load the Internet Explorer proxy settings?  
    http://dotnetjunkies.com/WebLog/bikta/articles/61061.aspx.

    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,
    Lingzhi


    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.

    Thanks,
    Jagannath
    Monday, January 19, 2009 9:57 AM