|
在WinForm中通过HTTP协议向服务器端上传文件(18) break; default: goto case 1; } Stream loPostData = Request.GetRequestStream(); //loPostData.Write(lcPostData,0,lcPostData.Length); this.oPostStream.WriteTo(loPostData); byte[] buffer = new byte[this.oPostStream.Length]; buffer = this.oPostStream.ToArray(); Console.Write(Encoding.GetEncoding(1252).GetString(buffer,0,buffer.Length)); //*** Close the memory stream this.oPostStream.Close(); this.oPostStream = null; //*** Close the Binary Writer this.oPostData.Close(); this.oPostData = null; //*** Close Request Stream loPostData.Close(); // *** clear the POST buffer //this.cPostBuffer = ""; } // *** Retrieve the response headers HttpWebResponse Response = (HttpWebResponse) Request.GetResponse(); // ** Save cookies the server sends if (this.bHandleCookies) { if (Response.Cookies.Count > 0) { if (this.oCookies == null) {
|