/// <summary> /// 发送get请求 /// </summary> /// <param name="uid">账号</param> /// <param name="password">密码</param> /// <param name="verifycode">验证码</param> /// <param name="appid">appid</param> /// <param name="login_sig">login_sig</param> /// <returns></returns> public static string QQZoneLogin(string uid, string password, string verifycode, string appid, string login_sig, string verifysession) { //string registerURL = string.Format("http://ptlogin2.qq.com/login?u1=http%3A%2F%2Fqzs.qq.com%2Fqzone%2Fv5%2Floginsucc.html%3Fpara%3Dizone&h=1&ptredirect=0&ptlang=2052&from_ui=1&dumy=&low_login_enable=0®master=&fp=loginerroralert&action=3-12-1435109093237&mibao_css=&t=1&g=1&js_ver=10126&js_type=1&pt_uistyle=12&pt_randsalt=0&pt_3rd_aid=&pt_vcode_v1=0&pt_verifysession_v1={5}&u={0}&verifycode={1}&p={2}&login_sig={3}&aid={4}&", uid, verifycode, password, login_sig, appid,verifysession); //string html = httphelper.GetAndGetHtml(registerURL, null, null, false, Encoding.UTF8); //return html; string html; string host = "ptlogin2.qq.com"; string path = string.Format("login?u1=http%3A%2F%2Fqzs.qq.com%2Fqzone%2Fv5%2Floginsucc.html%3Fpara%3Dizone&h=1&ptredirect=0&ptlang=2052&from_ui=1&dumy=&low_login_enable=0®master=&fp=loginerroralert&action=3-12-1435109093237&mibao_css=&t=1&g=1&js_ver=10126&js_type=1&pt_uistyle=12&pt_randsalt=0&pt_3rd_aid=&pt_vcode_v1=0&pt_verifysession_v1={5}&u={0}&verifycode={1}&p={2}&login_sig={3}&aid={4}&", uid, verifycode, password, login_sig, appid,verifysession); HttpHelperSocket HttpHelperSocket = new HttpHelperSocket(); IDictionary<string, string> cookies = new Dictionary<string, string>(); HttpHelperSocket.GetHtml(host, path, 80, "utf-8", "get", "", out html, cookies,""); return html; }
public static string TalkAboutFaBiao(string html1) { //获取相关cookies ZhuaHelper zhuahelper = new ZhuaHelper(html1); string supertoken = zhuahelper.GetInfo("supertoken"); //supertoken string superkey = zhuahelper.GetInfo("superkey"); //superkey string skey = zhuahelper.GetInfo("skey"); string uin = "o0343701675"; string pt2gguin = "o0343701675"; string ptui_loginuin="343701675"; string o_cookie="343701675"; string referer = "http://user.qzone.qq.com/343701675?ptsig=" + superkey; //发送cookies IDictionary<string, string> cookies = new Dictionary<string, string>(); cookies.Add("p_skey", superkey); cookies.Add("skey", skey); cookies.Add("pt2gguin", pt2gguin); cookies.Add("uin", uin); cookies.Add("ptui_loginuin", ptui_loginuin); cookies.Add("o_cookie", o_cookie); string formData = string.Format("con={0}&hostuin={1}&ode_version=1&qzreferrer={2}", "qmaaa", "343701675", referer); //HttpHelper httphelper1 = new HttpHelper(cookies); //string html = httphelper1.PostCookiesAndGetHtml("http://user.qzone.qq.com/q/taotao/cgi-bin/emotion_cgi_publish_v6", formData, null, referer, false, Encoding.UTF8); string html; HttpHelperSocket HttpHelperSocket = new HttpHelperSocket(); HttpHelperSocket.GetHtml("user.qzone.qq.com", "q/taotao/cgi-bin/emotion_cgi_publish_v6?g_tk=" + supertoken, 80, "utf-8", "post", formData, out html, cookies, referer); return html; //1887188366 }
/// <summary> /// 获取login_sig /// </summary> /// <param name="html">传入的html值</param> /// <returns></returns> public static string GetLogin_sig() { string html; string host = "ui.ptlogin2.qq.com"; string path = "cgi-bin/login?hide_title_bar=1&low_login=0&qlogin_auto_login=1&no_verifyimg=1&link_target=blank&appid=549000912&style=12&target=self&s_url=http://qzs.qq.com/qzone/v5/loginsucc.html?para=izone&pt_qr_app=�ֻ�QQ�ռ�&pt_qr_link=http://z.qzone.com/download.html&self_regurl=http://qzs.qq.com/qzone/v6/reg/index.html&pt_qr_help_link=http://z.qzone.com/download.html"; HttpHelperSocket HttpHelperSocket = new HttpHelperSocket(); IDictionary<string,string> cookies=new Dictionary<string,string>(); HttpHelperSocket.GetHtml(host, path, 80, "gb2312", "get", "", out html, cookies,""); ZhuaHelper zhuahelper = new ZhuaHelper(html); string login_sig = zhuahelper.GetInfo("login_sig"); return login_sig; }