Пример #1
0
        //参数审核
        private void CheckUserInfo()
        {
            string authstr = Utility.MD5(p1 + p2);

            if (authstr != p3)
            {
                Response.Write("<span style=\"color:red\">签名错误</span>");
                //Response.Redirect("Error.htm");
            }
            else
            {
                //验证用户
                int            userID         = Utility.StrToInt(p1, 0);
                AccountsFacade accountsFacade = new AccountsFacade( );
                Message        msg            = accountsFacade.GetUserGlobalInfo(userID, 0, "");
                if (msg.Success)
                {
                    UserInfo user = msg.EntityList[0] as UserInfo;
                    if (user.LogonPass != p2)
                    {
                        Response.Write("<span style=\"color:red\">密码错误</span>");
                        //Response.Redirect("Error.htm");
                    }
                    else
                    {
                        UserID = userID;
                    }
                }
                else
                {
                    Response.Write("<span style=\"color:red\">用户不存在</span>");
                    //Response.Redirect("Error.htm");
                }
            }
        }
        public JsonResult Get()
        {
            List <Account> lstAccounts;

            lstAccounts = AccountsFacade.GetAll();

            return(Json(lstAccounts));
        }
Пример #3
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "application/json";

            //验证登陆

            if (!FacadeManage.aidePlatformManagerFacade.CheckedUserLogon())
            {
                return;
            }

            //自定义头像
            int customID = GameRequest.GetInt("customid", 0);

            if (customID == 0)
            {
                return;
            }

            AccountsFacade accountsFacade = new AccountsFacade();
            AccountsFace   faceModel      = accountsFacade.GetAccountsFace(customID);

            if (faceModel == null)
            {
                return;
            }
            else
            {
                byte[] faceByte = ( byte[] )faceModel.CustomFace;

                // 新建画布
                int    width  = 48;
                int    height = 48;
                Bitmap bitmap = new Bitmap(width, height);

                // 循环像素
                int site = 4;
                for (int y = 0; y < 48; y++)
                {
                    for (int x = 0; x < 48; x++)
                    {
                        byte b = faceByte[site - 4];
                        byte g = faceByte[site - 3];
                        byte r = faceByte[site - 2];
                        bitmap.SetPixel(x, y, Color.FromArgb(r, g, b));
                        site = site + 4;
                    }
                }

                // 输出图片
                System.IO.MemoryStream ms = new System.IO.MemoryStream( );
                bitmap.Save(ms, System.Drawing.Imaging.ImageFormat.Bmp);
                context.Response.ClearContent( );
                context.Response.ContentType = "image/jpeg";
                context.Response.BinaryWrite(ms.ToArray( ));
                bitmap.Dispose( );
            }
        }
Пример #4
0
        public JsonResult Get()
        {
            List <Account> lstAccounts;

            lstAccounts = AccountsFacade.GetAll();

            //This line is different !!
            return(new JsonConvert.SerializeObject(lstAccounts));
        }
Пример #5
0
 public int UserID(string account)
 {
     try
     {
         AccountsFacade aideUserFacade = new AccountsFacade();
         UserInfo       m = aideUserFacade.GetAccountInfoByAccount(account);
         return(m.UserID);
     }
     catch { return(0); }
 }
Пример #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //财富排行
            TreasureFacade treasureFacade = new TreasureFacade();
            DataSet        ds             = treasureFacade.GetScoreRanking(10);

            rptScoreRanking.DataSource = ds;
            rptScoreRanking.DataBind();

            //魅力排行
            AccountsFacade accountsFacade = new AccountsFacade();

            ds = accountsFacade.GetLovesRanking(10);
            rptLovesRanking.DataSource = ds;
            rptLovesRanking.DataBind();
        }
Пример #7
0
 public int ifExist(int GameID)
 {
     try
     {
         var            sqlstr         = "select * from [QPAccountsDB].[dbo].[AccountsInfo] where GameID =" + GameID + "";
         AccountsFacade aideUserFacade = new AccountsFacade();
         DataSet        ds             = aideUserFacade.GetAccountInfoByGameID(sqlstr);
         if (ds.Tables[0].Rows.Count > 0)
         {
             return(int.Parse(ds.Tables[0].Rows[0]["UserID"].ToString()));
         }
         else
         {
             return(0);
         }
     }
     catch { return(0); }
 }