Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string result = "";

            try
            {
                //HttpCookie aCookie = Request.Cookies["societyguester"];
                HttpCookie aCookie = Request.Cookies["t"];
                if (aCookie != null)
                {
                    string value = aCookie.Value;
                    string uid   = string.Empty;
                    if (!string.IsNullOrEmpty(ValidateUrl))
                    {
                        //key:  MD5(code + trace + s + 约定值)
                        string sign  = BaseInterface.md5(Code + TraceStr + value + Key);
                        string param = string.Format("s={0}&trace={1}&code={2}&key={3}", HttpUtility.UrlEncode(value), TraceStr, Code, sign);

                        result = BaseInterface.RequestContent(ValidateUrl + "?" + param);

                        if (!string.IsNullOrEmpty(result) && result.IndexOf("ok") != -1)
                        {
                            string[] para = result.Split(':');
                            uid    = para[1];
                            result = "0";
                        }
                    }
                    else
                    {
                        result = "0";
                    }

                    if (result == "0")
                    {
                        string password = Guid.NewGuid().ToString();
                        int    time     = BaseInterface.ConvertDateTimeInt(DateTime.Now);
                        string v        = BaseInterface.md5(uid + password + time.ToString() + BaseInterface.GetLoginKey);
                        string Url      = BaseInterface.LoginUrl + "?content=" + HttpUtility.UrlEncode(uid + "|" + password + "|" + time.ToString() + "|" + v);
                        result = BaseInterface.RequestContent(Url);
                        if (result == "0")
                        {
                            string flashUrl = FlashUrl + "?user="******"&key=" + HttpUtility.UrlEncode(password);
                            Response.Redirect(flashUrl, false);
                            return;
                        }
                        result = "";
                    }
                }

                Response.Redirect(LoginOnUrl, false);
            }
            catch
            {
                Response.Redirect(LoginOnUrl, false);
            }
        }
Esempio n. 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if ((Session["username"] == null) && string.IsNullOrEmpty(Session["username"].ToString()))
            {
                Response.Redirect("~/Login.htm");
            }
            string result = "";

            try
            {
                string name     = Session["username"].ToString();
                string password = Guid.NewGuid().ToString();
                string time     = BaseInterface.ConvertDateTimeInt(DateTime.Now).ToString();
                string key      = string.Empty;

                if (string.IsNullOrEmpty(key))
                {
                    key = BaseInterface.GetLoginKey;
                }
                string v   = BaseInterface.md5(name + password + time.ToString() + key);
                string Url = (BaseInterface.LoginUrl + "?content=" + HttpUtility.UrlEncode(name + "|" + password + "|" + time.ToString() + "|" + v));
                result = BaseInterface.RequestContent(Url);
                if (result == "0")
                {
                    string flashUrl = FlashUrl + "?user="******"&key=" + HttpUtility.UrlEncode(password) + "&editby=Trminhpc";
                    if ("1" == ConfigurationManager.AppSettings["content2"])
                    {
                        password = (Session["password"] == null) ? password : Session["password"].ToString();
                        string iv        = "5C90D3C2C576A773";
                        string keyEncode = "5628eb9a3485fbf61f51927b8a8eee03c5962c6b64847aeb";
                        string origin    = name + "|" + password;
                        flashUrl = FlashUrl + "?content2=" + CryptoHelper.TripleDesEncrypt(keyEncode, origin, ref iv);
                    }
                    Response.Redirect(flashUrl, false);
                }
                else
                {
                    Response.Write(result);
                }
            }
            catch (Exception ex)
            {
                Response.Write(ex.ToString());
            }
        }
Esempio n. 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string mailTitle   = "大幅度是";
            string mailContent = "大幅度是";
            string username    = "******";
            string gold        = "6666";
            string money       = "99999";
            //param格式://int templateID, int count, int validDate, int StrengthenLevel, int AttackCompose, int DefendCompose, int AgilityCompose, int LuckCompose, bool isBinds
            string param = "11020,4,0,0,0,0,0,0,1|7014,2,9,400,400,400,400,400,0";


            string content = mailTitle + "#" + mailContent + "#" + username + "#" + gold + "#" + money + "#" + param + "#";

            DateTime time = DateTime.Now;

            string key = "asdfgh";
            string v   = BaseInterface.md5(username + gold + money + param + BaseInterface.ConvertDateTimeInt(time) + key);

            content = content + BaseInterface.ConvertDateTimeInt(time) + "#" + v;

            Response.Redirect("http://192.168.0.4:828/SentReward.ashx?content=" + Server.UrlEncode(content));
        }