Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 3
0
        public static string GetProxyInProcess()
        {
            int num = 0;

            byte[] array = new byte[1];
            num = array.Length;
            if (!URLMonInterop.InternetQueryOption(IntPtr.Zero, 38, array, ref num) && num != array.Length)
            {
                array = new byte[num];
                num   = array.Length;
                URLMonInterop.InternetQueryOption(IntPtr.Zero, 38, array, ref num);
            }
            return(Utilities.ByteArrayToHexView(array, 16));
        }
Ejemplo n.º 4
0
 public static void ResetProxyInProcessToDefault()
 {
     URLMonInterop.UrlMkSetSessionOption_1(37u, null, 0u, 0u);
 }
Ejemplo n.º 5
0
 public static void SetUAStringInProcess(string sUA)
 {
     URLMonInterop.UrlMkSetSessionOption(268435457u, sUA, (uint)sUA.Length, 0u);
 }