C# Can';我不能通过POST登录
我正在开发C# Can';我不能通过POST登录,c#,authentication,post,C#,Authentication,Post,我正在开发C#WinForms应用程序,它可以连接到网页,登录并获取一些数据 我的登录部分没有成功-我在这里读了几十篇文章,但都不起作用 我试图访问的页面是基于ASP.NET的。除此之外,我是网络开发新手 登录页面中的代码块: <form action="/User/Login" id="LoginForm" method="post"><input id="returnUrl" name="returnUrl" type="hidden" value="/">
C#WinForms应用程序
,它可以连接到网页,登录并获取一些数据
我的登录部分没有成功-我在这里读了几十篇文章,但都不起作用
我试图访问的页面是基于ASP.NET的。除此之外,我是网络开发新手
登录页面中的代码块:
<form action="/User/Login" id="LoginForm" method="post"><input id="returnUrl" name="returnUrl" type="hidden" value="/">
<td>
<input id="login" name="login" style="width:150px;" type="text" value="" />
</td>
<td>
<input id="pass" name="pass" style="width:150px;" type="password">
</td>
<span class="ButtonWrap">
<a href="javascript:submit();" class="ButtonGreen">Login</a>
</span>
<input type="submit">
var response = Http.Post("...desired web page...", new System.Collections.Specialized.NameValueCollection() {
{ "login", "loginData" },
{ "heslo", "passData" }
});
public static class Http
{
public static byte[] Post(string uri, System.Collections.Specialized.NameValueCollection pairs)
{
byte[] response = null;
using (WebClient client = new WebClient())
{
response = client.UploadValues(uri, "POST", pairs);
}
return response;
}
}
有人能帮我或导航吗,怎么了?为什么
td
标签在表单中@Mivaweb我删除了一些格式标签,因为我想缩短文章的篇幅。但如果需要的话,我可以发布整个区块。