日期:2014-05-17  浏览次数:20758 次

模拟登入的时候post信息怎么拼接?
做一个模拟登入的功能, 
这个是网站地址 http://feedstuffs.com/login.aspx
ParametersBase.Container = new CookieContainer();
postData = "这里的内容怎么写?"
ASCIIEncoding encoding = new ASCIIEncoding();
byte[] data = encoding.GetBytes(postData);
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(loginUrl);
request.Method = "Post";
request.ContentType = "application/x-www-form-urlencoded";
request.ContentLength = data.Length;
request.KeepAlive = true;
request.CookieContainer = ParametersBase.Container;  

------解决方案--------------------
假装登录一下, 然后用Fiddler2 拦截一下消息, 看看呗