private void button_Click(object sender EventArgs e)
{
//打開注冊表鍵
MicrosoftWinRegistryKey rk = MicrosoftWinRegistryCurrentUserOpenSubKey(@Software\Microsoft\Windows\CurrentVersion\Internet Settings true);
//設置代理可用
rkSetValue(ProxyEnable );
//設置代理IP和端口
rkSetValue(ProxyServer thistextBoxTextToString() + : + thistextBoxTextToString());
rkClose();
FactoryExecuteNonQuery(update IP set area= where address= + str + );
thisdataGridViewDataSource = FactoryGetDataTable(select * from ip);
MessageBoxShow(成功!!!);
}
private void button_Click(object sender EventArgs e)
{
//打開注冊表鍵
MicrosoftWinRegistryKey rk = MicrosoftWinRegistryCurrentUserOpenSubKey(@Software\Microsoft\Windows\CurrentVersion\Internet Settings true);
//設置代理不可用
rkSetValue(ProxyEnable ); rkClose(); MessageBoxShow(成功!!!);
}
From:http://tw.wingwit.com/Article/program/net/201311/11651.html