Пример #1
0
        public static bool login(string username, string passwd)
        {
            string  sql = string.Format("update user set fingerprint =1 where username='******' and passwd= '{1}'", username, passwd);
            int     num = MySQLTool.runSql(sql);
            DataSet ds  = DBhelper.getDS(sql);

            if (ds.Tables[0].Rows.Count > 0)
            {
                return(true);
            }
            return(false);
        }
Пример #2
0
        public static bool reg(UserModel user)
        {
            string sql = string.Format("insert into user (username,passwd) values ('{0}','{1}')", user.Username, user.Passwd);

            try
            {
                int num = MySQLTool.runSql(sql);
                return(true);
            }catch (Exception e)
            {
                return(false);
            }
        }
Пример #3
0
        public static bool login(string username, string passwd)
        {
            string sql = string.Format("update user set fingerprint =- fingerprint where username='******' and passwd= '{1}'", username, passwd);
            int    num = MySQLTool.runSql(sql);

            if (num > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #4
0
        public static bool usernameExist(UserModel user)
        {
            string sql = string.Format("select * from user where username ={0}", user.Username);
            int    num = MySQLTool.runSql(sql);

            if (num > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }