// 登陆 public bool Login(ref string logRturnStr) { // 获取验证码图片 string scURL = "https://www.16pu.com/safecode.jhtml?id=0.3594586764922329"; Response resp = r.Get(scURL, "", ref cookies); Bitmap img = resp.getImg(); // 识别验证码 SafeCode SCRead = new SafeCode(); string sc = SCRead.read2dig(img); // Post登陆,获取返回页面文本 string logURL = "https://www.16pu.com/jsonloginzy.jhtml"; string postDataStr = "username="******"&password="******"&safecode=" + sc; resp = r.Post(logURL, postDataStr, ref cookies); String reStr = resp.getText(); // 读取登陆返回的Json字符串,判断是否登陆成功 dynamic loginRturn = Comm.JsonRead(reStr); if (loginRturn["rmsg"] != "ok") { logRturnStr = loginRturn["rmsg"]; return(false); } Requests.SaveCookies(cookies, username);//保存成功登陆的Cookies文件 logRturnStr = username + " 登陆成功"; return(true); }
public override bool Equals(object obj) { if (obj is null) { return(false); } if (!(obj is Character)) { return(false); } Character other = (Character)obj; if (!Name.Equals(other.Name)) { return(false); } if (!LikeTags.Equals(other.LikeTags)) { return(false); } if (!DislikeTags.Equals(other.DislikeTags)) { return(false); } if (!SafeCode.Equals(other.SafeCode)) { return(false); } return(true); }