Example #1
0
        public static void SetProxyDisabledForProcess()
        {
            URLMonInterop.INTERNET_PROXY_INFO iNTERNET_PROXY_INFO = new URLMonInterop.INTERNET_PROXY_INFO();
            iNTERNET_PROXY_INFO.dwAccessType = 1u;
            iNTERNET_PROXY_INFO.lpszProxy    = (iNTERNET_PROXY_INFO.lpszProxyBypass = null);
            uint dwLen = (uint)Marshal.SizeOf(iNTERNET_PROXY_INFO);

            URLMonInterop.UrlMkSetSessionOption_1(38u, iNTERNET_PROXY_INFO, dwLen, 0u);
        }
Example #2
0
        public static void SetProxyInProcess(string sProxy, string sBypassList)
        {
            URLMonInterop.INTERNET_PROXY_INFO iNTERNET_PROXY_INFO = new URLMonInterop.INTERNET_PROXY_INFO();
            iNTERNET_PROXY_INFO.dwAccessType    = 3u;
            iNTERNET_PROXY_INFO.lpszProxy       = sProxy;
            iNTERNET_PROXY_INFO.lpszProxyBypass = sBypassList;
            uint dwLen = (uint)Marshal.SizeOf(iNTERNET_PROXY_INFO);

            URLMonInterop.UrlMkSetSessionOption_1(38u, iNTERNET_PROXY_INFO, dwLen, 0u);
        }
Example #3
0
 public static void ResetProxyInProcessToDefault()
 {
     URLMonInterop.UrlMkSetSessionOption_1(37u, null, 0u, 0u);
 }