Prehaut,
You will have to make the following declarations:
[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)]
public struct WINHTTP_AUTOPROXY_OPTIONS
{
[MarshalAs(UnmanagedType.U4)]
public int dwFlags;
[MarshalAs(UnmanagedType.U4)]
public int dwAutoDetectFlags;
public stirng lpszAutoConfigUrl;
public IntPtr lpvReserved;
[MarshalAs(UnmanagedType.U4)]
public int dwReserved;
public bool fAutoLoginIfChallenged;
}
[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)]
public struct WINHTTP_PROXY_INFO
{
[MarshalAs(UnmanagedType.U4)]
public int dwAccessType;
public string lpszProxy;
public string lpszProxyBypass;
}
[DllImport("winhttp.dll", SetLastError=true, CharSet=CharSet.Unicode)]
public static extern bool WinHttpGetProxyForUrl(
IntPtr hSession,
string lpcwszUrl,
ref WINHTTP_AUTOPROXY_OPTIONS pAutoProxyOptions,
ref WINHTTP_PROXY_INFO pProxyInfo
);
--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)
Thanx, I've found the "WinGetHttpProxyForUrl"
But how can I use it in my C# code ???
Thx for regards
Anselme
"Nicholas Paldino [.NET/C# MVP]" <
[email protected]> a écrit
dans le message de Anselme,
You can get the proxy information by making a call to
WinGetHttpProxyForUrl. However, this shouldn't be needed, as the
default
implementation of IWebProxy (returned through the static GetDefaultProxy
on
the WebProxy class) should use the IE settings.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)
Hi,
I have found the script of the .pac where to obtain the specification
to
obtain a proxy when we use IE
This adress is in the
HKCU\Softawre\Microsoft\Windows\CurrentVersion\Internet
Settings\AutoConfigURL
I have the adress of a script,
How can I obtain trough which proxy I need to pass ???
Thx
Anselme