问题描述
请求代码程序是在本地,用X-Wall代理连接的Wish。publicstringPostWebReq(stringPostUrl,stringParamData,EncodingDataEncode){stringret=string.Empty;try{byte[]byteArray=DataEncode.GetBytes(ParamData);HttpWebRequestwebReq=(HttpWebRequest)WebRequest.Create(newUri(PostUrl));webReq.Method="POST";webReq.ContentType="application/x-www-form-urlencoded";webReq.ContentLength=byteArray.Length;StreamnewStream=webReq.GetRequestStream();newStream.Write(byteArray,0,byteArray.Length);newStream.Close();HttpWebResponseresponse=(HttpWebResponse)webReq.GetResponse();StreamReadersr=newStreamReader(response.GetResponseStream(),DataEncode);ret=sr.ReadToEnd();sr.Close();response.Close();newStream.Close();}catch(WebExceptionex){Console.WriteLine(ex.StackTrace+"--"+ex.ToString());}finally{}returnret;
解决方案
本帖最后由 huangyewei1 于 2015-04-23 10:55:04 编辑