当前位置:编程学习 > C#/ASP.NET >>

httpwebrequest post数据到服务器没响应

我在做一个自动发帖的功能,目标网站是一个小门户,发帖不用登陆,只会检测IP,内容有标题,联系人,内容等等..
HttpWebRequest myRequest =
        (HttpWebRequest)WebRequest.Create(Url);

        myRequest.Method = "POST";
        myRequest.KeepAlive = true;
        myRequest.UserAgent = "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; QQDownload 691; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; .NET4.0E; 4399Box.1035; 4399Box.1035)";
        myRequest.Accept = "image/jpeg, application/x-ms-application, image/gif, application/xaml+xml, image/pjpeg, application/x-ms-xbap, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, */*";
        myRequest.ContentType = "text/html; charset=gb2312";
        myRequest.ContentLength = data.Length;
        myRequest.AllowWriteStreamBuffering = false;
        Stream newStream = myRequest.GetRequestStream();
        int len = (int)myRequest.ContentLength;
        // Send the data. 
        newStream.Write(data, 0, len);  这里的newStream说此流不支持查找操作,不过不会抛异常
        newStream.Close();

        WebResponse Wr = myRequest.GetResponse();
        Stream Stream = Wr.GetResponseStream();
        StreamReader Sr = new StreamReader(Stream);
        string strHTML = Sr.ReadToEnd();
        Response.Write(strHTML); 

执行完了什么错也没有报, 得到的strHTML还是没发帖之前的,跟之前没有变化,服务器端也没有反应, 
求赐教  --------------------编程问答-------------------- --------------------编程问答-------------------- 服务器端是你写的吗,要是你写的就简单了,在服务器端设置一个断点看看你到底post什么数据过去,和直接网页post有啥差别,然后慢慢调试肯定能搞出来。
补充:.NET技术 ,  ASP.NET
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,