首页 新闻 会员 周边 捐助

帮忙解释一段代码 关于c#设置IE代理

0
[已关闭问题] 关闭于 2008-01-09 21:33
<P>读注册表</P> <P>&nbsp; public&nbsp;&nbsp; void&nbsp;&nbsp; GetProxySetting()&nbsp;&nbsp; <BR>&nbsp; {&nbsp;&nbsp; <BR>&nbsp; int&nbsp;&nbsp; Proxy_Enabled;&nbsp;&nbsp; <BR>&nbsp; //track&nbsp;&nbsp; to&nbsp;&nbsp; the&nbsp;&nbsp; SubKey&nbsp;&nbsp; <BR>&nbsp; RegistryKey&nbsp;&nbsp; rkey&nbsp;&nbsp; =&nbsp;&nbsp; Registry.CurrentUser;&nbsp;&nbsp; <BR>&nbsp; RegistryKey&nbsp;&nbsp; software&nbsp;&nbsp; =&nbsp;&nbsp; rkey.OpenSubKey("Software");&nbsp;&nbsp; <BR>&nbsp; RegistryKey&nbsp;&nbsp; microsoft&nbsp;&nbsp; =&nbsp;&nbsp; software.OpenSubKey("Microsoft");&nbsp;&nbsp; <BR>&nbsp; RegistryKey&nbsp;&nbsp; windows&nbsp;&nbsp; =&nbsp;&nbsp; microsoft.OpenSubKey("Windows");&nbsp;&nbsp; <BR>&nbsp; RegistryKey&nbsp;&nbsp; currentversion&nbsp;&nbsp; =&nbsp;&nbsp; windows.OpenSubKey("CurrentVersion");&nbsp;&nbsp; <BR>&nbsp; RegistryKey&nbsp;&nbsp; internetsettings&nbsp;&nbsp; =&nbsp;&nbsp; currentversion.OpenSubKey("Internet&nbsp;&nbsp; Settings");&nbsp;&nbsp; <BR>&nbsp; Proxy_Enabled&nbsp;&nbsp; =&nbsp;&nbsp; Convert.ToInt32(internetsettings.GetValue("ProxyEnable"));&nbsp;&nbsp; <BR>&nbsp; //if&nbsp;&nbsp; ProxyEnable&nbsp;&nbsp; is&nbsp;&nbsp; true&nbsp;&nbsp; <BR>&nbsp; if&nbsp;&nbsp; (Proxy_Enabled!=0)&nbsp;&nbsp; <BR>&nbsp; {&nbsp;&nbsp; <BR>&nbsp; string&nbsp;&nbsp; ProxySettings=internetsettings.GetValue("ProxyServer").ToString();&nbsp;&nbsp; <BR>&nbsp; int&nbsp;&nbsp; i&nbsp;&nbsp; =&nbsp;&nbsp; ProxySettings.IndexOf(":");&nbsp;&nbsp; <BR>&nbsp; int&nbsp;&nbsp; j&nbsp;&nbsp; =&nbsp;&nbsp; ProxySettings.Length;&nbsp;&nbsp; <BR>&nbsp; textBox_AddressNow.Text=ProxySettings.Remove(i,j-i);&nbsp;&nbsp; <BR>&nbsp; textBox_PortNow.Text=ProxySettings.Remove(0,i+1);&nbsp;&nbsp; <BR>&nbsp; }&nbsp;&nbsp; <BR>&nbsp; }</P>
杜耀辉的主页 杜耀辉 | 菜鸟二级 | 园豆:275
提问于:2008-01-07 13:51
< >
分享
所有回答(1)
0
不就是读注册表么,你到底是哪个地方不明白?
deerchao | 园豆:8367 (大侠五级) | 2008-01-08 08:52
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册