protected void Button1_Click(object sender, EventArgs e) { if (this.TextBox2.Text != "terry0077") { return; } string nick = string.Empty; string session = string.Empty; nick = this.TextBox1.Text; //utils.NewRequest("nick", utils.RequestType.QueryString); string sql = "SELECT * FROM TopTaobaoShop WHERE nick = '" + nick + "'"; DataTable dt = utils.ExecuteDataTable(sql); if (dt.Rows.Count != 0) { session = dt.Rows[0]["sessiongroupbuy"].ToString(); } //加密NICK Rijndael_ encode = new Rijndael_("tetesoft"); nick = encode.Encrypt(nick); Cookie cookie = new Cookie(); cookie.setCookie("top_sessiongroupbuy", session, 999999); cookie.setCookie("nick", nick, 999999); Response.Redirect("indexgroup.html"); }
private void ShowErrPage() { //加密NICK Rijndael_ encode = new Rijndael_("tetesoft"); nick = encode.Encrypt(nick); Cookie cookie = new Cookie(); cookie.setCookie("nick", nick, 999999); Response.Write(" <b style='font-size:14px;'> 亲,您好!本服务用于:<span style='color:red'>好评有礼-会员营销 的客户做前台展示,没有订购 <a href='http://fuwu.taobao.com/serv/detail.htm?service_id=4545&from=xiuxiu'>好评有礼-会员营销</a> 则不可使用本服务</span>,给您带来的不便深感抱歉! <br> <a href='reviewnew/html1.aspx?session=" + top_session + "' target=_blank>过期用户清除宝贝描述中好评图片请点这里</a><br> <a href='http://groupbuy.7fshop.com/top/groupbuy/deletegroupbuy.aspx?session=" + top_session + "&nick=" + HttpUtility.UrlEncode(nick) + "' target=_blank>过期用户清除团购宝贝描述中图片请点这里</a> <br></b>"); // <a href='reviewnew/html1.aspx?session=" + top_session + "'>清除宝贝描述中好评图片请点这里</a> }
protected void Page_Load(object sender, EventArgs e) { string session = utils.NewRequest("session", utils.RequestType.QueryString); string nick = utils.NewRequest("nick", utils.RequestType.QueryString); string s = utils.NewRequest("short", utils.RequestType.QueryString); Cookie cookie = new Cookie(); Rijndael_ encode = new Rijndael_("tetesoft"); nick = encode.Encrypt(nick); cookie.setCookie("top_session", session, 999999); cookie.setCookie("nick", nick, 999999); cookie.setCookie("short", s, 999999); Response.Redirect("indexios.html"); }
private void GetData(string nick) { string session = top_session; TopXmlRestClient client = new TopXmlRestClient("http://gw.api.taobao.com/router/rest", top_appkey, app_secret); //获取店铺基本信息 UserGetRequest request = new UserGetRequest(); request.Fields = "user_id,nick,seller_credit"; request.Nick = nick; string oldNick = nick; User user = client.UserGet(request, session); if (CheckUserExits(nick)) { //更新登录次数和最近登陆时间 string sql = "UPDATE TCS_ShopSession SET session='" + top_session + "',version='" + versionNo + "' WHERE nick = '" + nick + "'"; utils.ExecuteNonQuery(sql); } else { //记录该会员的店铺信息 InsertUserInfo(nick); } IDictionary <string, string> param = new Dictionary <string, string>(); string result = Post("http://gw.api.taobao.com/router/rest", top_appkey, app_secret, "taobao.increment.customer.permit", top_session, param); //更新用户订购信息 CheckUser("0", nick); //加密NICK Rijndael_ encode = new Rijndael_("tetesoft"); nick = encode.Encrypt(nick); Common.Cookie cookie = new Common.Cookie(); cookie.setCookie("top_sessionsale", top_session, 999999); cookie.setCookie("nick", nick, 999999); Response.Redirect("indexsale.html"); }
private string EncodeStr(string[] parmArray) { string newStr = string.Empty; for (int i = 0; i < parmArray.Length; i++) { if (i == 0) { newStr = parmArray[i]; } else { newStr += "|" + parmArray[i]; } } Rijndael_ encode = new Rijndael_("tetesoftstr"); newStr = encode.Encrypt(newStr); newStr = HttpUtility.UrlEncode(newStr); return(newStr); }
protected void Page_Load(object sender, EventArgs e) { string nick = utils.NewRequest("nick", utils.RequestType.QueryString); string sql = "SELECT * FROM TCS_ShopSession WHERE nick = '" + nick + "' AND version > 0 AND version < 4"; Common.Cookie cookie = new Common.Cookie(); DataTable dt = utils.ExecuteDataTable(sql); if (dt.Rows.Count != 0) { Rijndael_ encode = new Rijndael_("tetesoft"); nick = encode.Encrypt(nick); cookie.setCookie("top_sessionblog", dt.Rows[0]["session"].ToString(), 999999); cookie.setCookie("nick", nick, 999999); } else { cookie.delCookie("top_sessionblog"); cookie.delCookie("nick"); } }
private void GetData() { //string session = utils.NewRequest("top_session", utils.RequestType.QueryString); ////string session = "23200d282b335fc82ee9466c363c14f7e1b03"; //string nick = string.Empty; //TopXmlRestClient client = new TopXmlRestClient("http://gw.api.taobao.com/router/rest", "12132145", "1fdd2aadd5e2ac2909db2967cbb71e7f"); ////通过获取当前会话客户的在销商品来获取用户NICK //ItemsOnsaleGetRequest request1 = new ItemsOnsaleGetRequest(); //request1.PageSize = 1; //request1.Fields = "nick"; //PageList<Item> item = client.ItemsOnsaleGet(request1, session); //if (item.Content.Count == 0) //{ // Response.Write("请您先在店铺里添加商品 <a href='http://i.taobao.com/my_taobao.htm'>我的淘宝</a>"); // Response.End(); // return; //} //else //{ // nick = item.Content[0].Nick; //} ////获取店铺基本信息 //UserGetRequest request = new UserGetRequest(); //request.Fields = "user_id,nick,seller_credit"; //request.Nick = nick; //User user = client.UserGet(request, session); //if(CheckUserExits(nick)) //{ // //更新该会员的店铺信息 //} //else //{ // //记录该会员的店铺信息 // InsertUserInfo(nick); //} string nick = string.Empty; string session = string.Empty; nick = Request.QueryString["nick"]; //utils.NewRequest("nick", utils.RequestType.QueryString); Response.Write(nick); Response.End(); string sql = "SELECT * FROM TopTaobaoShop WHERE nick = '" + nick + "'"; DataTable dt = utils.ExecuteDataTable(sql); if (dt.Rows.Count != 0) { session = dt.Rows[0]["sessiongroupbuy"].ToString(); } //加密NICK Rijndael_ encode = new Rijndael_("tetesoft"); nick = encode.Encrypt(nick); Cookie cookie = new Cookie(); cookie.setCookie("top_sessiongroupbuy", session, 999999); cookie.setCookie("nick", nick, 999999); Response.Redirect("indexgroup2.html"); }
private void GetData(string nick) { string session = top_session; //string session = "23200d282b335fc82ee9466c363c14f7e1b03"; TopXmlRestClient client = new TopXmlRestClient("http://gw.api.taobao.com/router/rest", "12159997", "614e40bfdb96e9063031d1a9e56fbed5"); //通过获取当前会话客户的在销商品来获取用户NICK //ItemsOnsaleGetRequest request1 = new ItemsOnsaleGetRequest(); //request1.PageSize = 1; //request1.Fields = "nick"; //PageList<Item> item = client.ItemsOnsaleGet(request1, session); //if (item.Content.Count == 0) //{ // Response.Write("请您先在店铺里添加商品 <a href='http://i.taobao.com/my_taobao.htm'>我的淘宝</a>"); // Response.End(); // return; //} //else //{ // nick = item.Content[0].Nick; //} //获取店铺基本信息 UserGetRequest request = new UserGetRequest(); request.Fields = "user_id,nick,seller_credit"; request.Nick = nick; User user = client.UserGet(request, session); if (CheckUserExits(nick)) { //更新该会员的店铺信息 //记录2次登录日志 string sql = "INSERT INTO TopLoginLog (" + "nick " + " ) VALUES ( " + " '" + nick + "'" + ") "; utils.ExecuteNonQuery(sql); //更新登录次数和最近登陆时间 sql = "UPDATE toptaobaoshop SET logintimes = logintimes + 1,lastlogin = GETDATE(),session='" + top_session + "',versionNo='" + versionNo + "' WHERE nick = '" + nick + "'"; utils.ExecuteNonQuery(sql); } else { //记录该会员的店铺信息 InsertUserInfo(nick); } //更新用户订购信息 CheckUser("0", nick); //加密NICK Rijndael_ encode = new Rijndael_("tetesoft"); nick = encode.Encrypt(nick); Common.Cookie cookie = new Common.Cookie(); cookie.setCookie("top_sessionblog", top_session, 999999); cookie.setCookie("nick", nick, 999999); Response.Redirect("indexnew.html"); }
private void GetData(string nick) { string session = top_session; TopXmlRestClient client = new TopXmlRestClient("http://gw.api.taobao.com/router/rest", "12159997", "614e40bfdb96e9063031d1a9e56fbed5"); //获取店铺基本信息 UserGetRequest request = new UserGetRequest(); request.Fields = "user_id,nick,seller_credit"; request.Nick = nick; string oldNick = nick; User user = client.UserGet(request, session); if (versionNo == "1") { versionNo = "2"; } if (CheckUserExits(nick)) { string plus = string.Empty; if (versionNo == "2") { plus = "freecard"; } if (versionNo == "3") { plus = "crm|freecard"; } //更新登录次数和最近登陆时间 string sql = "UPDATE TCS_ShopSession SET session='" + top_session + "',version='" + versionNo + "',plus='" + plus + "' WHERE nick = '" + nick + "'"; utils.ExecuteNonQuery(sql); //更新特殊用户 sql = "UPDATE TCS_ShopSession SET version = 2 WHERE nick = '玩具第一城'"; utils.ExecuteNonQuery(sql); //更新特殊用户 sql = "UPDATE TCS_ShopSession SET version = 3 WHERE nick = '魔女茶花'"; utils.ExecuteNonQuery(sql); } else { //记录该会员的店铺信息 InsertUserInfo(nick); } InsertConfigInfo(nick, session, versionNo); IDictionary <string, string> param = new Dictionary <string, string>(); string result = Post("http://gw.api.taobao.com/router/rest", "12159997", "614e40bfdb96e9063031d1a9e56fbed5", "taobao.increment.customer.permit", top_session, param); //更新用户订购信息 CheckUser("0", nick); //加密NICK Rijndael_ encode = new Rijndael_("tetesoft"); nick = encode.Encrypt(nick); Common.Cookie cookie = new Common.Cookie(); cookie.setCookie("top_sessionblog", top_session, 999999); cookie.setCookie("top_sessiongroupbuy", top_session, 999999); cookie.setCookie("nick", nick, 999999); //Response.Redirect("http://www.7fshop.com/top/market/setcookie.aspx?t=1&nick=" + HttpUtility.UrlEncode(nick)); if (isFirst == "1") { Response.Write("<span style='font-size:18px; font-weight:bold'>好评有礼真情回馈,恭喜您获得我们送出的首次订购赠送的<font color=red>【" + sendMsg + "】</font>条短信,感谢您的使用,您的支持是我们的最大动力!</span><hr><input type=button value='开始使用服务' onclick='window.location.href=\"indexnew.html\"'>"); Response.End(); } else { Response.Redirect("indexnew.html"); } }
private void QQLogin() { Common.Cookie cookie = new Common.Cookie(); string verify = cookie.getCookie("qqverify"); string url = "http://ptlogin2.qq.com/login?u=" + Request.Form["tbUserName"] + "&p=" + Request.Form["tbPassword"].ToUpper() + "&verifycode=" + Request.Form["tbVerify"] + "&aid=46000101&u1=http%3A%2F%2Ft.qq.com&ptredirect=1&h=1&from_ui=1&dumy=&fp=loginerroralert"; //准备生成 string strHtml = string.Empty; StreamReader sr = null; //用来读取流 StreamWriter sw = null; //用来写文件 Encoding code = Encoding.GetEncoding("utf-8"); //定义编码 ASCIIEncoding encoding = new ASCIIEncoding(); //构造web请求,发送请求,获取响应 WebRequest HttpWebRequest = null; HttpWebRequest = WebRequest.Create(url); HttpWebRequest.Headers.Set("Cookie", "verifysession=" + verify + ";"); //发送 WebResponse HttpWebResponse = null; HttpWebResponse = HttpWebRequest.GetResponse(); //获得流 sr = new StreamReader(HttpWebResponse.GetResponseStream(), code); strHtml = sr.ReadToEnd(); string aaa = HttpWebResponse.Headers.Get("Set-Cookie").ToString(); //保存进COOKIE string cookieStr = string.Empty; cookieStr += getKeyData(@"pt2gguin=([^;]*);", aaa); cookieStr += getKeyData(@"uin=([^;]*);", aaa); cookieStr += getKeyData(@"skey=([^;]*);", aaa); cookieStr += getKeyData(@"ptcz=([^;]*);", aaa); //保存登录状态 Rijndael_ encode = new Rijndael_("tetesoft"); cookie.setCookie("tmpQQ", encode.Encrypt(cookieStr), 999999); cookieStr += "verifysession=" + verify + ";"; //请求说说首页获取COOKIE url = "http://t.qq.com"; HttpWebRequest = WebRequest.Create(url); HttpWebRequest.Headers.Set("Cookie", cookieStr); //获得流 sr = new StreamReader(HttpWebResponse.GetResponseStream(), code); strHtml = sr.ReadToEnd(); //发送 HttpWebResponse = null; HttpWebResponse = HttpWebRequest.GetResponse(); string direct = HttpWebResponse.ResponseUri.ToString(); url = direct; HttpWebRequest = WebRequest.Create(url); HttpWebRequest.Headers.Set("Cookie", cookieStr); //获得流 sr = new StreamReader(HttpWebResponse.GetResponseStream(), code); strHtml = sr.ReadToEnd(); //发送 HttpWebResponse = null; HttpWebResponse = HttpWebRequest.GetResponse(); string ccc = HttpWebResponse.Headers.ToString(); cookie.setCookie("tCookie", cookieStr.Replace(";", "|"), 999999); cookie.setCookie("directUrl", direct, 999999); return; }
private void GetData(string nick) { string session = top_session; //string session = "23200d282b335fc82ee9466c363c14f7e1b03"; TopXmlRestClient client = new TopXmlRestClient("http://gw.api.taobao.com/router/rest", "12579331", "02314dab9db5c4255129ad772dd65424"); //通过获取当前会话客户的在销商品来获取用户NICK //ItemsOnsaleGetRequest request1 = new ItemsOnsaleGetRequest(); //request1.PageSize = 1; //request1.Fields = "nick"; //PageList<Item> item = client.ItemsOnsaleGet(request1, session); //if (item.Content.Count == 0) //{ // Response.Write("请您先在店铺里添加商品 <a href='http://i.taobao.com/my_taobao.htm'>我的淘宝</a>"); // Response.End(); // return; //} //else //{ // nick = item.Content[0].Nick; //} //获取店铺基本信息 /*UserGetRequest request = new UserGetRequest(); * request.Fields = "user_id,nick,seller_credit"; * request.Nick = nick; * User user = client.UserGet(request, session);*/ //加入推荐好友判断 Tuijian(nick); if (CheckUserExits(nick)) { //更新该会员的店铺信息 string ip = Request.UserHostAddress; //记录2次登录日志 string sql = "INSERT INTO TopLoginLog (" + "nick " + " ) VALUES ( " + " '" + nick + "'" + ") "; utils.ExecuteNonQuery(sql); //更新登录次数和最近登陆时间 sql = "UPDATE toptaobaoshop SET logintimes = logintimes + 1,lastlogin = GETDATE(),session='" + top_session + "',sessionmarket='" + top_session + "',ip='" + ip + "' WHERE nick = '" + nick + "'"; utils.ExecuteNonQuery(sql); } else { try { //记录该会员的店铺信息 InsertUserInfo(nick); } catch { } } try { //更新用户订购信息 CheckUser("1", nick); } catch { } //加密NICK Rijndael_ encode = new Rijndael_("tetesoft"); nick = encode.Encrypt(nick); Common.Cookie cookie = new Common.Cookie(); cookie.setCookie("top_sessionbao", top_session, 999999); cookie.setCookie("nick", nick, 999999); Response.Redirect("indexbao.html"); }
protected void Page_Load(object sender, EventArgs e) { Response.AddHeader("P3P", "CP=CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"); string strSPID = "29230000ea039296234e9d74d8d3d5b7"; string strSKEY = "2dsi35b3fdx050a41jufbnzirrlqd9kl"; string strUIN = utils.NewRequest("useruin", utils.RequestType.QueryString); string strTOKEN = utils.NewRequest("usertoken", utils.RequestType.QueryString); ApiClient client = new ApiClient(strSPID, strSKEY, Convert.ToInt32(strUIN), strTOKEN); //通过以下的接口函数添加这些参数 client.addParamInStringField("sellerUin", strUIN); client.invokeApi("http://api.paipai.com/shop/getShopInfo.xhtml?charset=utf-8"); string result = client.ToString(); string sql = string.Empty; //记录到本地数据库 sql = "SELECT COUNT(*) FROM TopPaipaiShop WHERE sellerUin = '" + strUIN + "'"; string count = utils.ExecuteString(sql); if (count == "0") { sql = "INSERT INTO TopPaipaiShop (" + "sellerUin, " + "shopName, " + "logo, " + "regTime, " + "authenticated, " + "mainBusiness, " + "sellerLocation, " + "cityId, " + "sellerLevelCount, " + "guaranteeCompensation, " + "property, " + "itemCountOnSale, " + "goodDescriptionMatch, " + "attitudeOfService, " + "speedOfDelivery, " + "goodEval, " + "normalEval, " + "badEval, " + "sigTencent, " + "sigPaipai " + " ) VALUES ( " + " '" + getValue(result, "sellerUin") + "', " + " '" + getValue(result, "shopName") + "', " + " '" + getValue(result, "logo") + "', " + " '" + getValue(result, "regTime") + "', " + " '" + getValue(result, "authenticated") + "', " + " '" + getValue(result, "mainBusiness") + "', " + " '" + getValue(result, "sellerLocation") + "', " + " '" + getValue(result, "cityId") + "', " + " '" + getValue(result, "sellerLevelCount") + "', " + " '" + getValue(result, "guaranteeCompensation") + "', " + " '" + getValue(result, "property") + "', " + " '" + getValue(result, "itemCountOnSale") + "', " + " '" + getValue(result, "goodDescriptionMatch") + "', " + " '" + getValue(result, "attitudeOfService") + "', " + " '" + getValue(result, "speedOfDelivery") + "', " + " '" + getValue(result, "goodEval") + "', " + " '" + getValue(result, "normalEval") + "', " + " '" + getValue(result, "badEval") + "', " + " '" + getValue(result, "sigTencent") + "', " + " '" + getValue(result, "sigPaipai") + "' " + ") "; } else { sql = "UPDATE TopPaipaiShop SET lastlogin = GETDATE(), logintimes = logintimes + 1 WHERE sellerUin = '" + strUIN + "'"; } Rijndael_ encode = new Rijndael_("tetesoft"); strUIN = encode.Encrypt(strUIN); Common.Cookie cookie = new Common.Cookie(); cookie.setCookie("top_session", strTOKEN, 999999); cookie.setCookie("nick", strUIN, 999999); utils.ExecuteNonQuery(sql); Response.Redirect("qqindex.html"); }
private string QQLogin() { Common.Cookie cookie = new Common.Cookie(); string verify = cookie.getCookie("qqverify"); string url = "http://ptlogin2.qq.com/login?u=" + Request.Form["tbUserName"] + "&p=" + Request.Form["tbPassword"].ToUpper() + "&verifycode=" + Request.Form["tbVerify"] + "&aid=46000101&u1=http%3A%2F%2Ft.qq.com&ptredirect=1&h=1&from_ui=1&dumy=&fp=loginerroralert"; url = "http://ptlogin2.qq.com/login?u=" + Request.Form["tbUserName"] + "&p=" + Request.Form["tbPassword"].ToUpper() + "&verifycode=" + Request.Form["tbVerify"] + "&low_login_enable=1&low_login_hour=720&=on&aid=15000101&u1=http%3A%2F%2Fimgcache.qq.com%2Fqzone%2Fv5%2Floginsucc.html%3Fpara%3Dizone&ptredirect=1&h=1&from_ui=1&dumy=&fp=loginerroralert"; //准备生成 string strHtml = string.Empty; StreamReader sr = null; //用来读取流 StreamWriter sw = null; //用来写文件 Encoding code = Encoding.GetEncoding("utf-8"); //定义编码 ASCIIEncoding encoding = new ASCIIEncoding(); //构造web请求,发送请求,获取响应 WebRequest HttpWebRequest = null; HttpWebRequest = WebRequest.Create(url); HttpWebRequest.Headers.Set("Cookie", "verifysession=" + verify + ";"); //if (proxy != "") //{ // string[] proxyArray = proxy.Split(':'); // HttpWebRequest.Proxy = new WebProxy(proxyArray[0], int.Parse(proxyArray[1])); // HttpWebRequest.Timeout = 40000; //} //发送 WebResponse HttpWebResponse = null; HttpWebResponse = HttpWebRequest.GetResponse(); //获得流 sr = new StreamReader(HttpWebResponse.GetResponseStream(), code); strHtml = sr.ReadToEnd(); //如果验证错误 /*if (strHtml.IndexOf("您输入的验证码有误") != -1) * { * Response.Write("<script>alert('您输入的验证码或帐号密码有误,请重新输入!');history.go(-1);</script>"); * Response.End(); * return ""; * }*/ //Response.Write("<script>alert('QQ空间自动发布程序升级中,请稍后使用!');history.go(-1);</script>"); //Response.End(); //return ""; string aaa = string.Empty; try { aaa = HttpWebResponse.Headers.Get("Set-Cookie").ToString(); } catch { Response.Write(verify + "<br>"); Response.Write(strHtml + "<br>"); Response.Write(HttpWebResponse.Headers.ToString()); Response.End(); return(""); } //保存进COOKIE string cookieStr = string.Empty; cookieStr += getKeyData(@"pt2gguin=([^;]*); ", aaa); cookieStr += getKeyData(@"ptcz=([^;]*); ", aaa); cookieStr += getKeyData(@"uin=([^;]*); ", aaa); cookieStr += getKeyData(@"skey=([^;]*); ", aaa); //保存登录状态 Rijndael_ encode = new Rijndael_("tetesoft"); cookie.setCookie("tmpQQ", encode.Encrypt(cookieStr), 999999); //cookieStr += "verifysession=" + verify + ";"; cookieStr += "ptisp=ctc;"; //请求说说首页获取COOKIE //url = "http://t.qq.com"; //HttpWebRequest = WebRequest.Create(url); //HttpWebRequest.Headers.Set("Cookie", cookieStr); ////获得流 //sr = new StreamReader(HttpWebResponse.GetResponseStream(), code); //strHtml = sr.ReadToEnd(); ////发送 //HttpWebResponse = null; //HttpWebResponse = HttpWebRequest.GetResponse(); //string direct = HttpWebResponse.ResponseUri.ToString(); //url = direct; //HttpWebRequest = WebRequest.Create(url); //HttpWebRequest.Headers.Set("Cookie", cookieStr); ////获得流 //sr = new StreamReader(HttpWebResponse.GetResponseStream(), code); //strHtml = sr.ReadToEnd(); ////发送 //HttpWebResponse = null; //HttpWebResponse = HttpWebRequest.GetResponse(); //string ccc = HttpWebResponse.Headers.ToString(); //cookie.setCookie("tCookie", cookieStr.Replace(";", "|"), 999999); //cookie.setCookie("directUrl", direct, 999999); return(cookieStr); }
protected void Page_Load(object sender, EventArgs e) { Response.AddHeader("P3P", "CP=CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"); /* * http://www.7fshop.com/top/container.aspx * ?top_appkey=12132145 * &top_parameters=aWZyYW1lPTEmdHM9MTI4NTg3MTY5Nzg0OSZ2aWV3X21vZGU9ZnVsbCZ2aWV3X3dpZHRoPTAmdmlzaXRvcl9pZD0xNzMyMzIwMCZ2aXNpdG9yX25pY2s90ra2+cvmx+W35w== * &top_session=23200857b2aa0ca62d3d0d9c78a750df07300 * &top_sign=52sdJ6lvJPeaBef7rwcoSw== * &agreement=true * &agreementsign=12132145-21431194-D1A5A27626CB119D69F0D5438423A99A * &y=13 * &x=36*/ //签名验证 string top_appkey = "12223169"; string top_parameters = utils.NewRequest("top_parameters", utils.RequestType.QueryString).Replace(" ", "+"); top_session = utils.NewRequest("top_session", utils.RequestType.QueryString).Replace(" ", "+"); string app_secret = "ff3d3442ab809930d187623ffad8e91e"; string top_sign = utils.NewRequest("top_sign", utils.RequestType.QueryString).Replace(" ", "+"); //字符串中的+在获取后会被替换成空格,要再替换回来 string sign = utils.NewRequest("sign", utils.RequestType.QueryString).Replace(" ", "+"); versionNo = utils.NewRequest("versionNo", utils.RequestType.QueryString); string leaseId = utils.NewRequest("leaseId", utils.RequestType.QueryString).Replace(" ", "+"); //可以从 QueryString 来获取,也可以固定 string timestamp = utils.NewRequest("timestamp", utils.RequestType.QueryString).Replace(" ", "+"); //可以从 QueryString 来获取 string agreementsign = utils.NewRequest("agreementsign", utils.RequestType.QueryString).Replace(" ", "+"); if (!Taobao.Top.Api.Util.TopUtils.VerifyTopResponse(top_parameters, top_session, top_sign, top_appkey, app_secret)) { Response.Write("top签名验证不通过,请不要非法注入"); Response.End(); return; } //验证客户版本参数是否正确 if (versionNo != "") { if (!VersionVerify(app_secret, sign, top_appkey, leaseId, timestamp, versionNo)) { //Response.Write("客户版本验证不通过,请不要自行修改参数"); //Response.End(); //return; } } else { versionNo = "1"; } //Response.Write("!!!通过"); //Response.End(); nick = Taobao.Top.Api.Util.TopUtils.DecodeTopParams(top_parameters)["visitor_nick"]; if (nick == null || nick == "") { Response.Write("top签名验证不通过,请不要非法注入"); Response.End(); return; } if (agreementsign != "") { //加密NICK Rijndael_ encode = new Rijndael_("tetesoft"); nick = encode.Encrypt(nick); Common.Cookie cookie = new Common.Cookie(); cookie.setCookie("top_sessionkai", top_session, 999999); cookie.setCookie("nick", nick, 999999); Response.Redirect("indexkai.html"); return; } //判断跳转 GetData(nick); }
private void GetData(string nick) { string session = top_session; //string session = "23200d282b335fc82ee9466c363c14f7e1b03"; TopXmlRestClient client = new TopXmlRestClient("http://gw.api.taobao.com/router/rest", "12223169", "ff3d3442ab809930d187623ffad8e91e"); //通过获取当前会话客户的在销商品来获取用户NICK //ItemsOnsaleGetRequest request1 = new ItemsOnsaleGetRequest(); //request1.PageSize = 1; //request1.Fields = "nick"; //PageList<Item> item = client.ItemsOnsaleGet(request1, session); //if (item.Content.Count == 0) //{ // Response.Write("请您先在店铺里添加商品 <a href='http://i.taobao.com/my_taobao.htm'>我的淘宝</a>"); // Response.End(); // return; //} //else //{ // nick = item.Content[0].Nick; //} //获取店铺基本信息 UserGetRequest request = new UserGetRequest(); request.Fields = "user_id,nick,seller_credit"; request.Nick = nick; User user = client.UserGet(request, session); if (CheckUserExits(nick)) { //更新该会员的店铺信息 //string ip = Request.UserHostAddress; //记录2次登录日志 /*string sql = "INSERT INTO TopLoginLog (" + * "nick " + * " ) VALUES ( " + * " '" + nick + "'" + * ") "; * utils.ExecuteNonQuery(sql);*/ //更新登录次数和最近登陆时间 string sql = "UPDATE TCS_ShopSession SET session='" + top_session + "',version='" + versionNo + "' WHERE nick = '" + nick + "'"; utils.ExecuteNonQuery(sql); } else { //记录该会员的店铺信息 InsertUserInfo(nick); } IDictionary <string, string> param = new Dictionary <string, string>(); string result = Post("http://gw.api.taobao.com/router/rest", "12223169", "ff3d3442ab809930d187623ffad8e91e", "taobao.increment.customer.permit", top_session, param); //更新用户订购信息 CheckUser("0", nick); //加密NICK Rijndael_ encode = new Rijndael_("tetesoft"); nick = encode.Encrypt(nick); Common.Cookie cookie = new Common.Cookie(); cookie.setCookie("top_sessionkai", top_session, 999999); cookie.setCookie("nick", nick, 999999); Response.Redirect("indexkai.html"); }
protected void Page_Load(object sender, EventArgs e) { //签名验证 string top_appkey = "12690738"; string top_parameters = utils.NewRequest("top_parameters", utils.RequestType.QueryString).Replace(" ", "+"); top_session = utils.NewRequest("top_session", utils.RequestType.QueryString).Replace(" ", "+"); string app_secret = "66d488555b01f7b85f93d33bc2a1c001"; string top_sign = utils.NewRequest("top_sign", utils.RequestType.QueryString).Replace(" ", "+"); //字符串中的+在获取后会被替换成空格,要再替换回来 string sign = utils.NewRequest("sign", utils.RequestType.QueryString).Replace(" ", "+"); versionNo = utils.NewRequest("versionNo", utils.RequestType.QueryString); string leaseId = utils.NewRequest("leaseId", utils.RequestType.QueryString).Replace(" ", "+"); //可以从 QueryString 来获取,也可以固定 string timestamp = utils.NewRequest("timestamp", utils.RequestType.QueryString).Replace(" ", "+"); //可以从 QueryString 来获取 string agreementsign = utils.NewRequest("agreementsign", utils.RequestType.QueryString).Replace(" ", "+"); if (!Taobao.Top.Api.Util.TopUtils.VerifyTopResponse(top_parameters, top_session, top_sign, top_appkey, app_secret)) { Response.Write("top签名验证不通过,请不要非法注入"); Response.End(); return; } nick = Taobao.Top.Api.Util.TopUtils.DecodeTopParams(top_parameters)["visitor_nick"]; if (nick == null || nick == "") { Response.Write("top签名验证不通过,请不要非法注入"); Response.End(); return; } ////加密NICK //Rijndael_ encode = new Rijndael_("tetesoft"); //nick = encode.Encrypt(nick); //Cookie cookie = new Cookie(); //cookie.setCookie("top_session", top_session, 999999); //cookie.setCookie("top_sessiongroupbuy", top_session, 999999); //cookie.setCookie("top_sessionblog", top_session, 999999); //cookie.setCookie("nick", nick, 999999); //Response.Redirect("indexnew1.html"); //return; File.WriteAllText(Server.MapPath("customer/" + nick + ".txt"), Request.Url.ToString()); if (nick == "langbow旗舰店") { Response.Redirect("http://iphone.tetesoft.com/api/container.aspx?nick=" + HttpUtility.UrlEncode(nick) + "&session=" + Session + "&short=langbow"); return; } //判断跳转,判断客户是否订购了好评有礼 string sql = "SELECT * FROM TCS_ShopSession WHERE nick = '" + nick + "' AND version > 1"; DataTable dt = utils.ExecuteDataTable(sql); if (dt.Rows.Count != 0) { //获取SESSION string session = dt.Rows[0]["session"].ToString(); if (session.Length != 0) { //加密NICK Rijndael_ encode = new Rijndael_("tetesoft"); nick = encode.Encrypt(nick); Cookie cookie = new Cookie(); cookie.setCookie("top_session", session, 999999); cookie.setCookie("top_sessiongroupbuy", session, 999999); cookie.setCookie("top_sessionblog", session, 999999); cookie.setCookie("nick", nick, 999999); Response.Redirect("indexnew.html"); } else { ShowErrPage(); return; } } else { ShowErrPage(); return; } }