动态代理服务器有关问题

动态代理服务器问题
我想通过动态改变 "代理地址 "的方法访问一个网址,可是第一个代理有效,以后不行这是为什么?有什么办法可以解决吗?先谢了!
Dim   proxyObject   As   New   WebProxy(代理地址,   True)
Dim   request   As   WebRequest   =   WebRequest.Create( "网址 ")
request.Proxy   =   proxyObject
Dim   response   As   HttpWebResponse   =   CType(request.GetResponse(),   HttpWebResponse)
response.Close()

------解决方案--------------------
WebProxy proxy = new WebProxy();
proxy = (WebProxy) request.Proxy;
string uriString = address+ ": "+port;
WebProxy proxy = new WebProxy();
proxy = (WebProxy) request.Proxy;
string uriString = Form1.C_Proxy_addr + ": " + Form1.C_Proxy_port;
if (uriString.Length > 0)
{
Uri uri = new Uri(uriString);
proxy.Address = uri;
proxy.Credentials = new NetworkCredential(Form1.C_Proxy_user, Form1.C_Proxy_pass);
request.Proxy = proxy;
}
;

------解决方案--------------------
在通过调用 GetRequestStream、BeginGetRequestStream、GetResponse 或 BeginGetResponse 方法启动请求之后,更改 Proxy 属性将引发 InvalidOperationException。有关代理元素的信息,请参见 defaultProxy 元素(网络设置)。

------解决方案--------------------
请问楼主确定需要使用WebBrowser控件吗?
如果确定需要使用WebBrowser控件,通常需要调用API函数InternetSetOption()来修改全局代理。

如果需要使用HTTPWebRequest类,可以直接修改其Proxy属性达到修改代理的目的。
------解决方案--------------------
我想 你为什么不用多线程 创建 不同的 代理用完了就释放,也不用修改