打开http://192.168.1.1/home.shtml后,
在其activate-key输入框中要输入一串激活码,如:8888888888
并且,点击Submit按钮提交激活,用HttpWebRequest/HttpWebResponse可以实现吗,如何实现?该段html如下:<div class="form1" id="test_activate" style="display: block;">
<form action="/test/activate-key" enctype="multipart/form-data" method="post">
<p><small><b>Activate</b>:
<input name="activate-key" type="text">
<input value="Submit" type="submit">
</p></form></div>
在其activate-key输入框中要输入一串激活码,如:8888888888
并且,点击Submit按钮提交激活,用HttpWebRequest/HttpWebResponse可以实现吗,如何实现?该段html如下:<div class="form1" id="test_activate" style="display: block;">
<form action="/test/activate-key" enctype="multipart/form-data" method="post">
<p><small><b>Activate</b>:
<input name="activate-key" type="text">
<input value="Submit" type="submit">
</p></form></div>
解决方案 »
- 做3个程序,如何控制这3个程序的同步
- 两个 DropDownList 绑定一个数据源 设置每个控件的选择值
- datagridview的单元格编辑问题,在线等,解决就结贴
- 如何用.NET摸拟网页提交?
- webbrowser怎么取得打开网页的cookie
- 关于C#与javascript的两个问题,请秋枫,凡瑞,小山等热心高手帮帮
- 当WinForm中的控件很多的时候,怎么让页面显示的更快?
- C#做手机端推送服务
- 《C#应用程序开发全程演练—从灵感到实现 》 的代码在哪?
- 求救~!!
- 模拟浏览器在编辑框中输入内容并点击提交按钮!
- 试过无数方法 至今纠结 问天下英雄 违反并发性: UpdateCommand 影响了预期 1 条记录中的 0 条。
string strNewValue;
string strResponse;
// Create the request obj
HttpWebRequest req = (HttpWebRequest) WebRequest.Create("http://someur.com/page.aspx");
// Set values for the request back
req.Method = "POST";
req.ContentType = "application/x-www-form-urlencoded";
strNewValue = strFormValues + "¶m1=value1&parm2=value2";
req.ContentLength = strNewValue.Length;
// Write the request
StreamWriter stOut = new StreamWriter (req.GetRequestStream(), System.Text.Encoding.ASCII);
stOut.Write(strNewValue);
stOut.Close();
// Do the request to get the response
StreamReader stIn = new StreamReader(req.GetResponse().GetResponseStream());
strResponse = stIn.ReadToEnd();
stIn.Close();code]
WebRequest - passing parameters using POST
模拟submit按钮
不知道该如何提交,最好是用HttpWebRequest/HttpWebResponse,或者WebClient也行,
大家不要惜字如金,多说些吧,帮帮我,