目标网站页面html代码,这是一个登陆页面
<form name="Form1" method="post" action="login.aspx" >
<input name="txtASI:txtText" type="text" maxlength="5" id="txtASI_txtText" />
<input name="txtUserName:txtText" type="text" maxlength="30" id="txtUserName_txtText" />
<input name="txtPassword:txtText" type="password" maxlength="30" id="txtPassword_txtText" />
<input type="submit" name="btnLogin" value="Log-In" id="btnLogin"  />
</form>=========================================
string param =System.Web.HttpUtility.UrlEncode("txtASI:txtText=88883&txtUserName:txtText=spot25&txtPassword:txtText=moneymoney");
string retstr=string.Empty;
this.txtshow.Text = param;
HttpWebRequest testRq = (HttpWebRequest)WebRequest.Create(url1);
CookieContainer cc = new CookieContainer();
testRq.CookieContainer = cc;
HttpWebResponse tessres = (HttpWebResponse)testRq.GetResponse();
StreamReader r = new StreamReader(tessres.GetResponseStream(),Encoding.UTF8);
r.Close();
tessres.Close();
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url1);
req.Method = "POST";
req.ContentType = "application/x-www-form-urlencoded";
req.AllowAutoRedirect = true;
req.CookieContainer = cc;
byte[] SomeBytes = null;
SomeBytes = Encoding.UTF8.GetBytes(param.ToString());
req.ContentLength = SomeBytes.Length;
Stream newStream = req.GetRequestStream();
newStream.Write(SomeBytes, 0, SomeBytes.Length);
newStream.Close();
HttpWebResponse res = (HttpWebResponse)req.GetResponse();可是还是没有得到登陆后的cookie值