封装两个NET函数给你
private string GetReg(string RegPath) 取得注册表项内容
{
string str=""
RegistryKey hkml = Registry.LocalMachine
RegistryKey software = hkml.OpenSubKey("SOFTWARE",true)
RegistryKey aimdir = software.OpenSubKey("krabs",true)
if (aimdir != null)
{
if (aimdir.GetValue(RegPath) != null)
str = aimdir.GetValue(RegPath).ToString()
if (str != null)
return str
return null
}
return null
}
private bool SetReg(string RegPath,string Data) //设置注册表内容
{
RegistryKey reg = Registry.LocalMachine
RegistryKey software = reg.OpenSubKey("SOFTWARE", true)
RegistryKey aimdir1 = software.CreateSubKey("krabs")
if (aimdir1 == null)
return false
aimdir1.SetValue(RegPath, Data)
return true
}
晕死,你的IP当然还是你的IP,这个只是修改IE的上网代理服务器设置而已,和你的本地IP地址根本没有任何关系。请参考:
怎样设置IE浏览器代理服务器_百度经验
http://jingyan.baidu.com/article/2fb0ba404f4f4e00f2ec5fd4.html
可以用Inet控件来实现:思路,让Inet用代理访问百度并获取源代码,如果能从源代码找到百度之类的字眼就可以了。方法:
工程-添加部件-找到microsoft internet transfer control 6.0
private sub form_load()
inet1.Proxy="192.168.1.100:3128"
dim temp as string
temp=inet1.openurl("www.baidu.com")
if instr(temp,"百度")>0 then
'有效
else
'无效
end if
end sub
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)