日期:2014-05-20 浏览次数:20820 次
/// <summary> /// 用户登录信息存储 /// </summary> public class UserInfo { /// <summary> /// 登录账号 /// </summary> public static String uid = ""; /// <summary> /// 登录密码 /// </summary> public static String pwd = ""; } /// <summary> /// 用户登录类 /// </summary> public class UserLogin { /// <summary> /// 登录方法 /// </summary> /// <param name="uid">账号</param> /// <param name="pwd">密码</param> public void Login(String uid,String pwd) { UserInfo.pwd = pwd; UserInfo.uid = uid; } } /// <summary> /// 数据库访问类 /// </summary> public class UserService { /// <summary> /// 添加信息 /// </summary> /// <param name="mes"></param> public void Add(String mes) { //获得登录人ID String uid = UserInfo.uid; //......................剩下的访问数据库内容略 } }