怎样通过HttpWebRequest 发送 POST 请求到一个网页服务器?例如编写个程序实现自动用户登录,自动提交表单数据到网站等。
假如某个页面有个如下的表单(Form):
<form name="form1" action="http://www.here.com/login.asp" method="post">
  <input type="text" name="userid" value="">
  <input type="password" name="password" value="">
</form>
    
用C#写提交程序:  string strId = "guest";
  string strPassword= "123456";  ASCIIEncoding encoding=new ASCIIEncoding();
  string postData="userid="+strId;
  postData += ("&password="+strPassword);
  byte[] data = encoding.GetBytes(postData);
  HttpWebRequest myRequest =
   (HttpWebRequest)WebRequest.Create("http://www.here.com/login.asp");
  myRequest.Method = "POST";
  myRequest.ContentType="application/x-www-form-urlencoded";
  myRequest.ContentLength = data.Length;
  Stream newStream=myRequest.GetRequestStream();
  newStream.Write(data,0,data.Length);
  newStream.Close();
我用axWebBrowser1看,为什么提交不成功?数据没有post进去。