Test if the HTTP agent works properly

xiaoxiao2021-03-06  59

If it is HTTP verification, send a request to the agent to see if there is any reaction! Httpwebrequest objhtpRequest; httpwebresponse objresponse; webproxy objProxy;

objHttpRequest = (HttpWebRequest) WebRequest.Create (m_strUrl); objHttpRequest.Timeout = 3000; objHttpRequest.AllowAutoRedirect = true; objHttpRequest.ContentType = "application / x-www-form-Urlencoded";

ObjProxy = new WebProxy (ProxyName, Portid); objProxy.bypassproxyonLocal = true; objProxy.credentials = New NetworkCredential (userid, pwd, domain);

ObjhttpRequest.proxy = objProxy; try {objresponse = (httpwebresponse) ObjhttpRequest.getResponse ();} catch (exception e) {throw E;

Scoket I have never written! !

转载请注明原文地址:https://www.9cbs.com/read-84082.html

New Post(0)