Exemplo n.º 1
0
 /// <summary>
 /// 用户注册
 /// </summary>
 /// <returns></returns>
 public static int User_Regist(string username, string pwd, string nickname)
 {
     if (GetUserByLoginId(username) != null)
     {   //用户存在
         return(-1);
     }
     else
     {
         string sql = "INSERT Users(LoginId,LoginPwd,Name,QQ,Mail) " +
                      "VALUES('" + username + "','" + pwd + "','" + nickname + "','Default','Default')";
         sql += " ; SELECT @@IDENTITY";
         int newId = SSMS.GetScalar(sql);
         if (newId != 0)
         {
             return(newId);
         }
         else
         {
             return(-1);
         }
     }
 }