日期:2014-05-20 浏览次数:20804 次
HttpWebRequest myReq = (HttpWebRequest)WebRequest.Create(strUrl);
myReq.Method = "post";
UTF8Encoding encoding = new UTF8Encoding();
CookieContainer cookies = new CookieContainer();
myReq.CookieContainer = cookies;
Cookie appCookie = new Cookie("ASP.NET_SessionId", sessionid);
myReq.CookieContainer.Add(new Uri(strUrl), appCookie);
myReq.ContentLength = byte1.Length;
myReq.ReadWriteTimeout = 1000;
Stream newStream = myReq.GetRequestStream();
newStream.Write(byte1, 0, byte1.Length);
newStream.Close();