111,092
社区成员




public static string doPost(string Url, byte[] postData, SinaCookie bCookie, String encodingFormat, String referer, string ProxyStr)
{
try
{
HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(Url.ToString());
if (ProxyStr != ""&&ProxyStr != null)
{
//设置代理
WebProxy proxy = new WebProxy();
proxy.Address = new Uri(ProxyStr);
myRequest.UseDefaultCredentials = true;
myRequest.Proxy = proxy;
}
//myRequest.ServicePoint.Expect100Continue = false;
myRequest.CookieContainer = bCookie.mycookie;
myRequest.Method = "POST";
myRequest.Timeout = 30000;
这样做就行了。