无为县城乡建设局网站wordpress博客页面修改
无为县城乡建设局网站,wordpress博客页面修改,郑州app下载,自适应网站制作费用近期需要对webbrower设置代理#xff0c;找到了如下方案#xff1a; 1. 对修改注册表#xff0c;设置全局代理 这种方法限制在一个进程内只能设置或取消代理#xff0c;而且是全局代理#xff0c;对于部分不需要代理对功能会产生影响 2. 通过函数InternetSetOption实现修改…近期需要对webbrower设置代理找到了如下方案 1. 对修改注册表设置全局代理 这种方法限制在一个进程内只能设置或取消代理而且是全局代理对于部分不需要代理对功能会产生影响 2. 通过函数InternetSetOption实现修改当前程序中的WebBrowser设置 1 static class WebBrowserProxy2 3 {4 5 struct Struct_INTERNET_PROXY_INFO6 7 {8 9 public int dwAccessType;
10
11 public IntPtr proxy;
12
13 public IntPtr proxyBypass;
14
15 };
16
17
18
19 [DllImport(wininet.dll, SetLastError true)]
20
21 static extern bool InternetSetOption(IntPtr hInternet, int dwOption, IntPtr lpBuffer,int lpdwBufferLength);
22
23
24
25 public static void SetProxy(string strProxy 127.0.0.1:8888)
26
27 {
28
29 const int INTERNET_OPTION_PROXY 38;
30
31 const int INTERNET_OPEN_TYPE_PROXY 3;
32
33
34
35 Struct_INTERNET_PROXY_INFO struct_IPI;
36
37
38
39 // Filling in structure
40
41 struct_IPI.dwAccessType INTERNET_OPEN_TYPE_PROXY;
42
43 struct_IPI.proxy Marshal.StringToHGlobalAnsi(strProxy);
44
45 struct_IPI.proxyBypass Marshal.StringToHGlobalAnsi(local);
46
47
48
49 // Allocating memory
50
51 IntPtr intptrStruct Marshal.AllocCoTaskMem(Marshal.SizeOf(struct_IPI));
52
53
54
55 // Converting structure to IntPtr
56
57 Marshal.StructureToPtr(struct_IPI, intptrStruct, true);
58
59 bool iReturn InternetSetOption(IntPtr.Zero, INTERNET_OPTION_PROXY, intptrStruct, Marshal.SizeOf(struct_IPI));
60
61 }
62
63 } 参考来源“https://blog.csdn.net/gold0523/article/details/38666701”转载于:https://www.cnblogs.com/yishilin/p/9513207.html
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/pingmian/88046.shtml
如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!