Пример #1
0
        public static bool UserIsTranVal(int iUserID)
        {
            bool   bRes    = false;
            string sTranID = TransPBLL.SelIsTranByUID(iUserID);

            if (sTranID.Length > 32)
            {
                bRes = true;
            }
            return(bRes);
        }
Пример #2
0
        public static string Login(string sUserID, string sGame, bool bRes)
        {
            string        site     = GetSite(sGame);
            string        key      = "DNTQ-16DD11-WAN-0668-daoDS50N-7ROAD-shenLQg-111SHEN";
            string        user     = sUserID;
            string        password = Guid.NewGuid().ToString("D");
            string        time     = ProvideCommon.getTime().ToString();
            StringBuilder sbText   = new StringBuilder();

            sbText.Append(user);
            sbText.Append(password);
            sbText.Append(time);
            sbText.Append(key);
            string sign    = ProvideCommon.MD5(sbText.ToString());//user+password+time+key
            string context = string.Format("{0}|{1}|{2}|{3}", user, password, time, sign);
            string sHost   = GetDomain(sGame);
            string preUrl  = string.Format("http://{0}/createlogin", sHost);

            sbText.Remove(0, sbText.Length);
            sbText.AppendFormat("content={0}&site={1}", context, site);
            int iUserID = 0;
            int iIsPay  = 0;

            if (int.TryParse(sUserID, out iUserID))
            {
                string sTranID = TransPBLL.SelIsTranByUID(iUserID);
                if (sTranID.Length > 32)
                {
                    iIsPay = 1;
                }
            }
            sbText.AppendFormat("&isCharge={0}", iIsPay.ToString());
            string sRes = ProvideCommon.GetPageInfoByPost(preUrl, sbText.ToString(), "UTF-8");

            if (sRes == "0")
            {
                string Url = string.Format("http://{0}/client/game.jsp?user={1}&key={2}&site={3}", sHost, user, password, site);
                if (bRes)
                {
                    GameLoginBLL.GameLoginAdd(iUserID, sGame, ProvideCommon.GetRealIP(), Url);
                }
                return(Url);
            }
            else
            {
                return(string.Format("http://www.dao50.com/fwqwh/?{0}|{1}", preUrl, sbText.ToString()));
            }
        }