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
Here is a complete code sample how to call WinHttpGetIEProxyConfigForCurrentUser method from winhttp.dll library in C#
[TestClass]
public class UnitTest1
{
[StructLayout(LayoutKind.Sequential)]
public struct WinhttpCurrentUserIeProxyConfig
{
[MarshalAs(UnmanagedType.Bool)]
public bool AutoDetect;
[MarshalAs(UnmanagedType.LPWStr)]
public string AutoConfigUrl;
[MarshalAs(UnmanagedType.LPWStr)]
public string Proxy;
[MarshalAs(UnmanagedType.LPWStr)]
public string ProxyBypass;
}
[DllImport("winhttp.dll", SetLastError = true)]
static extern bool WinHttpGetIEProxyConfigForCurrentUser(ref WinhttpCurrentUserIeProxyConfig pProxyConfig);
[TestMethod]
public void TestMethod1()
{
var config = new WinhttpCurrentUserIeProxyConfig();
WinHttpGetIEProxyConfigForCurrentUser(ref config);
Console.WriteLine(config.Proxy);
Console.WriteLine(config.AutoConfigUrl);
Console.WriteLine(config.AutoDetect);
Console.WriteLine(config.ProxyBypass);
}
}