Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Credits: Rogue: http://thebot.net/threads/c-changing-proxy-in-webbrowser-control.135271/
- void RefreshIESettings(string strProxy) {
- const int INTERNET_OPTION_PROXY = 38;
- const int INTERNET_OPEN_TYPE_PROXY = 3;
- Struct_INTERNET_PROXY_INFO s_IPI;
- s_IPI.dwAccessType = INTERNET_OPEN_TYPE_PROXY;
- s_IPI.proxy = System.Runtime.InteropServices.Marshal.StringToHGlobalAnsi(strProxy);
- s_IPI.proxyBypass = System.Runtime.InteropServices.Marshal.StringToHGlobalAnsi("Global");
- IntPtr intptrStruct = System.Runtime.InteropServices.Marshal.AllocCoTaskMem(System.Runtime.InteropServices.Marshal.SizeOf(s_IPI));
- System.Runtime.InteropServices.Marshal.StructureToPtr(s_IPI, intptrStruct, true);
- InternetSetOption(IntPtr.Zero, INTERNET_OPTION_PROXY, intptrStruct, System.Runtime.InteropServices.Marshal.SizeOf(s_IPI));
- }
- RefreshIEsettings();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement