小编自己的微信阅读平台源代码:
ASCIIEncoding encoding = new ASCIIEncoding();
string postData = "ValidCode=" + this.textBox2.Text + "&pid=1247";
byte[] data = encoding.GetBytes(postData);
HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create("http://show.qingdaobaby.com/Vote_doIP.asp");
myRequest.Method = "POST";
myRequest.ContentType = "application/x-www-form-urlencoded";//这个必须要加
myRequest.ContentLength = data.Length;
myRequest.Referer = "http://show.qingdaobaby.com";
myRequest.CookieContainer = cc;
Stream newStream = myRequest.GetRequestStream();
newStream.Write(data, 0, data.Length);
newStream.Close();
HttpWebResponse myResponse = (HttpWebResponse)myRequest.GetResponse();
StreamReader reader = new StreamReader(myResponse.GetResponseStream(), Encoding.Default);
string content = reader.ReadToEnd();
友情提示:一定要用专业的封包工具进行封包,否则会出现一些异常的情况。
版权申明:本篇文章属于原创,转载请注明出自微信投票网。原文地址: https://www.aivote.com/13292.html


