C# post 模拟提交multipart/form-data的问题
注册用户的时候,post的数据是这样的
-----------------------------309723120027804
Content-Disposition: form-data; name="regsubmit"
yes
-----------------------------309723120027804
Content-Disposition: form-data; name="formhash"
8d099a46
-----------------------------309723120027804
Content-Disposition: form-data; name="referer"
http://club.*******.com/./-------------------------这是网站
-----------------------------309723120027804
Content-Disposition: form-data; name="activationauth"
Content-Disposition: form-data; name="agreebbrule"
454b7635
-----------------------------309723120027804
Content-Disposition: form-data; name="x7uH0V"
注册用户名
-----------------------------309723120027804
Content-Disposition: form-data; name="RpRk10"
密码
-----------------------------309723120027804
Content-Disposition: form-data; name="djzWdq"
密码
-----------------------------309723120027804
Content-Disposition: form-data; name="Xc8eDO"
-----------------------------309723120027804
Content-Disposition: form-data; name="regsubmit"
提交
-----------------------------309723120027804--
我用如下方法提交数据,不知道为啥总是返回“抱歉,密码空或包含非法字符”。
没找出错误的地方。还是提交multipart/form-data不能这样写呢?
public string[] PostMethodMulti(string Postdata, string Urllogin, string Urlreffer, string boundary, string proxy)//temp[0]返回网页temp[1]返回cookies
{
try
{
request = (HttpWebRequest)WebRequest.Create(Urllogin);//实例化web访问类
if (proxy != "")
{
request.Proxy = new WebProxy(proxy, true);
request.Timeout = 2000;
}
request.Method = "POST";//数据提交方式为POST
requ