How do I find out the browser's proxy settings?

前端 未结 4 915
既然无缘
既然无缘 2020-12-01 02:48

I am writing a command-line tool for Windows that uses libcurl to download files from the internet.

Obviously, the downloading doesn\'t work when the user is behind

4条回答
  •  旧时难觅i
    2020-12-01 03:44

    There are registry keys for these values that you could get to directly of course. You could also do this in .NET without much hassle at all. I believe the WebClient object negotiates the proxy settings for you based on the current settings. This would look like this in C#:

    using System.Net;
    
    string url = "http://www.example.com";
    WebClient client = new WebClient();
    byte[] fileBuffer = client.DownloadFile(url);
    

    Or something close to that.

提交回复
热议问题