Esempio n. 1
0
        public WinHttpWebProxyFinder()
        {
            session = NativeMethods.WinHttp.WinHttpOpen(null, NativeMethods.WinHttp.AccessType.NoProxy, null, null, 0);
            if (session == null || session.IsInvalid)
            {
                int lastWin32Error = getLastWin32Error();
            }
            else
            {
                int downloadTimeout = 60 * 1000;
                if (NativeMethods.WinHttp.WinHttpSetTimeouts(session, downloadTimeout, downloadTimeout, downloadTimeout,
                                                             downloadTimeout))
                {
                    return;
                }

                int lastWin32Error = getLastWin32Error();
            }
        }
 internal static extern bool WinHttpGetProxyForUrl(WinHttpHandle session, string url,
                                                   [In] ref WINHTTP_AUTOPROXY_OPTIONS autoProxyOptions,
                                                   out WINHTTP_PROXY_INFO proxyInfo);
 internal static extern bool WinHttpSetTimeouts(WinHttpHandle session, int resolveTimeout,
                                                int connectTimeout, int sendTimeout, int receiveTimeout);