展开全部
给winform加一个webbrowser控件去
然后用webrequest
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(requestURL);
request.Method = "POST";
UTF8Encoding encoding = new UTF8Encoding();
byte[] data = encoding.GetBytes(PostString);
request.ContentType = "application/x-www-form-urlencoded";
request.ContentLength = data.Length;
Stream stream = request.GetRequestStream();
得到返回流以后
送给webbrowser的DocumentStream就好
然后用webrequest
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(requestURL);
request.Method = "POST";
UTF8Encoding encoding = new UTF8Encoding();
byte[] data = encoding.GetBytes(PostString);
request.ContentType = "application/x-www-form-urlencoded";
request.ContentLength = data.Length;
Stream stream = request.GetRequestStream();
得到返回流以后
送给webbrowser的DocumentStream就好
更多追问追答
追问
PostString
是什么意思?
得到返回流以后,怎么操作呢?
谢谢
追答
就是你要post过去的东西嘛
user=123&password=232
这样的嘛
webBrowser.DocumentStream = stream
好像是这样
我不大记得webBrowser.DocumentStream 是否是可写的
如果不可写
可以用StreamReader 读出来,变成string然后赋给DocumentText
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询