一、八个窗体 LoginForm(登录窗体) RegisterForm(注册窗体)――》FacesForm(选择头像的窗体) MainForm(主窗体) EditPersonInfoForm(编辑个人信息窗体) SearchFriendForm(查找好友窗体) ChatForm(聊天窗体:sbFriends_ItemDoubleClick 事件触发) Request(系统信息窗体) 二、各窗体界面及功能实现 1、LoginForm(登录窗体) 界面: 两个label: ForeColor 为 Highlight 两个LinkLabel: 两个Button: btnLogin, btnCannel (三个控件的背景色都设为透明) 两个TextBox: txtId, txtPwd 功能模块: 两个事件:btnLogin_click 事件和 linkLabel1_LinkClicked 在 btnLogin_click 事件中:首先声明两个变量 string id=txtId.text.trim(); string pwd=txtPwd.text.trim(); If(IsValidate()){ If(IsExist(id, pwd)){ 将登录的 QQ 号码和密码保存到 UserHelper 中 打开主窗体界面 }else{ 弹出用户名或密码错误的对消息对话框 } 两个方法: bool IsValidate() 用途:判断用户是否输入 调用处:btnLogin_click 事件中 方法体说明:不需声明 bool 变量,如果没有录入直接 return false, 否则 return true 即可 bool IsExist(string id, string pwd) 用途:判断是否在数据库 users 表中存在 调用处:btnLogin_click 事件中 方法体说明:在此方法中需要声明一个bool isExist=false,如果 count=1, isExist=true, 否则,isExist=false, 在 try{}finally{}外面 return isExist 2、RegisterForm(注册窗体) 界面: 两个GroupBox:grpBaseInfo(注册基本信息), grpDetails(选填详细信息) 五个TextBox: txtNickName, txtAge, txtPwd, txtRePwd, txtName 两个RadioButton:rdoMale, rdoFemale 两个ComboBox:cboStar, cboBloodType 两个Button: btnRegister, btnCannel 功能模块: 其实就是往数据库 users 表中添加一条记录,如果添加成功,马上查找出其记录自动生成的 ID 号返回给用户即可 两个事件: RegisterForm_Load 事件和 btnRegister_click 事件 在 RegisterForm_Load 事件中 就只调用 SetCboText()方法 在 btnRegister_click 事件中 if (IsValidate()) { string sqlString = GetSqlString(); int QQId = AddUser(sqlString); if (QQId != 0) { string message = string.Format("注册成功,你的QQ号码是{0}", QQId); Me...