熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> .NET編程 >> 正文

如何用C#設置IE的代理

2013-11-13 09:48:54  來源: .NET編程 

     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
    推薦文章
    Copyright © 2005-2013 電腦知識網 Computer Knowledge   All rights reserved.