[DllImport("winhttp.dll", SetLastError = true, CharSet = CharSet.Unicode)]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern Boolean WinHttpDetectAutoProxyConfigUrl(
UInt32 dwAutoDetectFlags,
[MarshalAs(UnmanagedType.LPWStr)] out String ppwstrAutoConfigUrl
);
Declare Function WinHttpDetectAutoProxyUrl Lib "winhttp.dll" (TODO) As TODO
None.
Do you know one? Please contribute it!
Values for dwAutoDetectFlags :
UInt32 WINHTTP_AUTO_DETECT_TYPE_DHCP = 0x00000001;
UInt32 WINHTTP_AUTO_DETECT_TYPE_DNS_A = 0x00000002;
or both
WINHTTP_AUTO_DETECT_TYPE_DHCP|WINHTTP_AUTO_DETECT_TYPE_DNS_A
If both the DHCP and DNS auto detect flags are set, DHCP is used first; if no PAC URL is discovered using DHCP, then DNS is used
Please add some!
String result;
if ( ! Winhttp.WinHttpDetectAutoProxyConfigUrl(Winhttp.WINHTTP_AUTO_DETECT_TYPE_DHCP|Winhttp.WINHTTP_AUTO_DETECT_TYPE_DNS_A, out result))
{
UInt32 error = (uint)Marshal.GetLastWin32Error();
System.Console.WriteLine("Error "+ error);
}
System.Console.WriteLine(result);