哈哈。碰到这种鸟参数居多的,几句代码就可以轻松搞定
[C#] 纯文本查看 复制代码 public override void Login()
{
xHttpResult result =
Client.Get(
"http://hwid1.vmall.com:8080/oauth2/portal/login.jsp?validated=true&service=http%3A%2F%2Fwww.vmall.com%2Faccount%2Fcaslogin%3Furl%3Dhttp%253A%252F%252Fwww.vmall.com%252F&loginChannel=26000000&reqClientType=26");
WebForm webfrom = WebForm.Parse(result);
if (webfrom != null)
{
webfrom["userAccount"] = Usr.UrlEncode();
webfrom["password"] = Pwd.UrlEncode();
webfrom["authcode"] = GetLoginVc().UrlEncode(); //取登录验证码
xHttpResult r = Client.Execute(webfrom);
String usrmsg = ",USR=" + Usr;
if (r.Text.Contains("用户名或密码错误"))
{
SetStatshandler("密码错误");
throw new ErrorException("小米:密码错误" + usrmsg);
}
if (r.Text.Contains("系统繁忙,请稍后重试"))
{
throw new RetryException("系统繁忙,请稍后重试" + usrmsg);
}
if (r.Text.Contains("花粉们太热情了"))
{
throw new RetryException("花粉们太热情了" + usrmsg);
}
if (r.Text.Contains("请过2小时后再试!"))
{
throw new ErrorException("请过2小时后再试!" + usrmsg);
}
if (r.Text.Contains("您登录错误次数过多"))
{
throw new ErrorException("您登录错误次数过多" + usrmsg);
}
SetStatshandler(!IsLogin() ? "登录Cookies错误" : "登录成功");
}
else
{
throw new ErrorException("打开登录页失败");
}
}
|