private DBLib SetParams(DBLib dbLib) { if (m_strID == "") { throw new Exception("用户名不能为空!"); } if (m_strRole == "") { throw new Exception("请选择用户的角色和权限!"); } if (!m_bEdit && m_strPsw == "") { throw new Exception("密码不能为空!"); } string strPsw; strPsw = FormsAuthentication.HashPasswordForStoringInConfigFile(m_strPsw, "md5"); //DBLib dbLib = new DBLib(); dbLib.AddParams("UserName", "'" + m_strID + "'"); if (m_strPsw != "") { dbLib.AddParams("[Password]", "'" + strPsw + "'"); } dbLib.AddParams("Rights", "'" + m_strRights + "'"); dbLib.AddParams("Role", "'" + m_strRole + "'"); return(dbLib); }