各位好,我打算使用webclient将资料送到http://96.0.72.67/test/jdebpnqj.html但是不知道那裹写的不对,老是得到错误信息:405不允许的方法
请大家帮我看一下
底下是我全部的code
WebClient wc = new WebClient();
wc.Encoding = Encoding.UTF8;
wc.Headers.Add("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-TW; rv:1.9.0.11) Gecko/2009060215 Firefox/3.0.11");
wc.Headers.Add("Referer", "http://96.0.72.67/test/jdebpnqj.html");
wc.Headers.Add("Content-Type", "application/x-www-form-urlencoded");
string uploadstring;
string html;
uploadstring = "my1=5&my2=2&my3=3&my41=4&my5=5&my6=6&Submit=out";
html = wc.UploadString("http://96.0.72.67/test/jdebpnqj.html", uploadstring);
请大家帮我看一下
底下是我全部的code
WebClient wc = new WebClient();
wc.Encoding = Encoding.UTF8;
wc.Headers.Add("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-TW; rv:1.9.0.11) Gecko/2009060215 Firefox/3.0.11");
wc.Headers.Add("Referer", "http://96.0.72.67/test/jdebpnqj.html");
wc.Headers.Add("Content-Type", "application/x-www-form-urlencoded");
string uploadstring;
string html;
uploadstring = "my1=5&my2=2&my3=3&my41=4&my5=5&my6=6&Submit=out";
html = wc.UploadString("http://96.0.72.67/test/jdebpnqj.html", uploadstring);
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head><body>
<form name="form1" method="post" action="jdebpnqj.php">
<p> my1
<input type="text" name="my1" >
</p>
<p> my2
<input type="text" name="my2" >
</p>
<p> my3
<input type="text" name="my3" >
</p>
<p> my4
<input type="text" name="my4" >
</p>
<p> my5
<input type="text" name="my5" >
</p>
<p> my6
<input type="text" name="my6" >
<input type="submit" name="Submit" value="out" >
</p>
</form></body>
</html>