电脑桌面
添加小米粒文库到电脑桌面
安装后可以在桌面快捷访问

MyQQ聊天程序设计VIP专享VIP免费

MyQQ聊天程序设计_第1页
MyQQ聊天程序设计_第2页
MyQQ聊天程序设计_第3页
聊天程序详细设计 小组成员表 组长:魏杰 成员:魏杰 周兰 验收项目:仿Q Q 聊天程序 一. 建立数据库 创建MyQQ 数据库 建立用户表“UserLog 的表“MessageLog UserLog 中有 xm(姓名),ID(账号),pw(密码),sq(权限),sj(时间) MessageLog 中有 fz(发送),sz(收收),xx(信息),sj(时间) 二、 基本框架 开始界面 登录界面 查看好友界面: 聊天界面: 取回密码界面: 注册界面: 注册成功界面: 具体代码实现见附件源代码 二. 实现数据库连接 添加 Data 类 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Data.SqlClient; using System.Data; namespace MyQQ { class Data { private static string constring = "server=.;database=MyQQ;uid=sa;pwd="; private static SqlConnection sqlcon = new SqlConnection(); private static SqlCommand sqlcom = new SqlCommand(); private static void openConnection() // 打开连接 { if (sqlcon.State == ConnectionState.Closed) { try { sqlcon.ConnectionString = constring; sqlcom.Connection = sqlcon; sqlcon.Open(); } catch (Exception e) { throw new Exception(e.Message); } } } private static void closeConnection()// 关闭连接 { if (sqlcon.State == ConnectionState.Open) { sqlcon.Close(); } sqlcon.Dispose(); sqlcom.Dispose(); } public static void ExecuteSql(string sqlStr)// 执行一条sql语句 { try { openConnection(); sqlcom.CommandType = CommandType.Text; sqlcom.CommandText = sqlStr; sqlcom.ExecuteNonQuery(); } catch (Exception e) { throw new Exception(e.Message); } finally { closeConnection(); } } public static DataSet ExecuteDataSet(string sqlStr)// 执行一条sql语句 { try { openConnection(); sqlcom.CommandType = CommandType.Text; sqlcom.CommandText = sqlStr; SqlDataAdapter sqlda = new SqlDataAdapter(sqlStr, sqlcon); DataSet ds = new DataSet(); sqlda.Fill(ds); return ds; } catch (Exception e) { throw new Exception(e.Message); } finally { ...

1、当您付费下载文档后,您只拥有了使用权限,并不意味着购买了版权,文档只能用于自身使用,不得用于其他商业用途(如 [转卖]进行直接盈利或[编辑后售卖]进行间接盈利)。
2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。
3、如文档内容存在违规,或者侵犯商业秘密、侵犯著作权等,请点击“违规举报”。

碎片内容

确认删除?
VIP
微信客服
  • 扫码咨询
会员Q群
  • 会员专属群点击这里加入QQ群
客服邮箱
回到顶部