请高手帮我看看,为什么总是出错WebClient
高手帮我测试下吧,我需要通过程序来登录网页
代码如下,为什么手工可以登录,代码却登录不了,老说“请填写必须字段”什么的
string uriString = "http://www.inang.cn/blog/login.asp?act=login ";
string postString = "userName=test&password=testtest&Login=Login&CookiesDay=1 ";
WebClient webClient = new WebClient();
webClient.Headers.Add( "Content-Type ", "application/x-www-form-urlencoded ");
byte[] postData = Encoding.ASCII.GetBytes(postString);
byte[] responseData = webClient.UploadData(uriString, "POST ", postData);
string srcString = Encoding.UTF8.GetString(responseData);
------解决方案--------------------up