资源简介
19441153C完美仿QQ聊天软件MyQQ源代码(北大青鸟完整版).rar
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace MyQQ
{
///
/// 聊天窗体
///
public partial class ChatForm : Form
{
public int friendId; // 当前聊天的好友号码
public string nickName; // 当前聊天的好友昵称
public int faceId; // 当前聊天的好友头像Id
public ChatForm()
{
InitializeComponent();
}
// 窗体加载时的动作
private void ChatForm_Load(object sender EventArgs e)
{
// 设置窗体标题
this.Text = string.Format(“与{0}聊天中“nickName);
// 设置窗体顶部显示的好友信息
picFace.Image = ilFaces.Images[faceId];
lblFriend.Text = string.Format(“{0}({1})“nickNamefriendId);
// 读取所有的未读消息,显示在窗体中
ShowMessage();
}
// 关闭窗体
private void btnClose_Click(object sender EventArgs e)
{
this.Close();
}
// 发送消息
private void btnSend_Click(object sender EventArgs e)
{
if (txtChat.Text.Trim() == ““) // 不能发送空消息
{
MessageBox.Show(“不能发送空消息!“ “提示“ MessageBoxButtons.OK MessageBoxIcon.Information);
return;
}
else if (txtChat.Text.Trim().Length > 50)
{
MessageBox.Show(“消息内容过长,请分为几条发送!“ “提示“ MessageBoxButtons.OK MessageBoxIcon.Information);
return;
}
else // 发送消息,写入数据库
{
// MessageTypeId:1-表示聊天消息,为简化操作没有读取数据表,到S2可以用常量或者枚举实现
// MessageState:0-表示消息状态是未读
int result = -1; // 表示操作数据库的结果
string sql = string.Format(
“INSERT INTO Messages (FromUserId ToUserId Message MessageTypeId MessageState) VALUES ({0}{1}‘{2}‘{3}{4})“
UserHelper.loginId friendId txtChat.Text.Trim() 1 0);
try
{
// 执行命令
SqlCommand command = new SqlCommand(sql DBHelper.connection);
DBHelper.connection.Open();
result = command.ExecuteNonQuery();
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
finally
{
DBHelper.connection.Close();
}
if (result != 1)
{
MessageBox.Show(“服务器出现意外错误!“ “抱歉“ MessageBoxButtons.OK MessageBoxIcon.Error);
}
txtChat.Text = ““; // 输入消息清空
this.Close();
}
}
///
/// 读取所有的未读消息,显示在窗体中
///
private
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 9156 2007-06-19 11:00 C#完美仿QQ聊天软件MyQQ源代码(北大青鸟完整版)\提供给学员的素材\声音文件\folder.wav
文件 9220 2007-06-19 11:00 C#完美仿QQ聊天软件MyQQ源代码(北大青鸟完整版)\提供给学员的素材\声音文件\msg.wav
文件 6947 2007-06-19 11:00 C#完美仿QQ聊天软件MyQQ源代码(北大青鸟完整版)\提供给学员的素材\声音文件\system.wav
文件 1080 2007-06-19 10:58 C#完美仿QQ聊天软件MyQQ源代码(北大青鸟完整版)\提供给学员的素材\头像图片\1-1.bmp
文件 4856 2007-06-19 11:02 C#完美仿QQ聊天软件MyQQ源代码(北大青鸟完整版)\提供给学员的素材\头像图片\1.bmp
文件 1080 2007-06-19 10:58 C#完美仿QQ聊天软件MyQQ源代码(北大青鸟完整版)\提供给学员的素材\头像图片\10-1.bmp
文件 4856 2007-06-19 11:02 C#完美仿QQ聊天软件MyQQ源代码(北大青鸟完整版)\提供给学员的素材\头像图片\10.bmp
文件 1080 2007-06-19 10:58 C#完美仿QQ聊天软件MyQQ源代码(北大青鸟完整版)\提供给学员的素材\头像图片\100-1.bmp
文件 4856 2007-06-19 11:02 C#完美仿QQ聊天软件MyQQ源代码(北大青鸟完整版)\提供给学员的素材\头像图片\100.bmp
文件 2680 2007-09-14 10:04 C#完美仿QQ聊天软件MyQQ源代码(北大青鸟完整版)\提供给学员的素材\头像图片\101.bmp
文件 1080 2007-06-19 10:58 C#完美仿QQ聊天软件MyQQ源代码(北大青鸟完整版)\提供给学员的素材\头像图片\11-1.bmp
文件 4856 2007-06-19 11:02 C#完美仿QQ聊天软件MyQQ源代码(北大青鸟完整版)\提供给学员的素材\头像图片\11.bmp
文件 1080 2007-06-19 10:58 C#完美仿QQ聊天软件MyQQ源代码(北大青鸟完整版)\提供给学员的素材\头像图片\12-1.bmp
文件 4856 2007-06-19 11:02 C#完美仿QQ聊天软件MyQQ源代码(北大青鸟完整版)\提供给学员的素材\头像图片\12.bmp
文件 1080 2007-06-19 10:58 C#完美仿QQ聊天软件MyQQ源代码(北大青鸟完整版)\提供给学员的素材\头像图片\13-1.bmp
文件 4856 2007-06-19 11:02 C#完美仿QQ聊天软件MyQQ源代码(北大青鸟完整版)\提供给学员的素材\头像图片\13.bmp
文件 1080 2007-06-19 10:58 C#完美仿QQ聊天软件MyQQ源代码(北大青鸟完整版)\提供给学员的素材\头像图片\14-1.bmp
文件 4856 2007-06-19 11:02 C#完美仿QQ聊天软件MyQQ源代码(北大青鸟完整版)\提供给学员的素材\头像图片\14.bmp
文件 1080 2007-06-19 10:58 C#完美仿QQ聊天软件MyQQ源代码(北大青鸟完整版)\提供给学员的素材\头像图片\15-1.bmp
文件 4856 2007-06-19 11:02 C#完美仿QQ聊天软件MyQQ源代码(北大青鸟完整版)\提供给学员的素材\头像图片\15.bmp
文件 1080 2007-06-19 10:58 C#完美仿QQ聊天软件MyQQ源代码(北大青鸟完整版)\提供给学员的素材\头像图片\16-1.bmp
文件 4856 2007-06-19 11:02 C#完美仿QQ聊天软件MyQQ源代码(北大青鸟完整版)\提供给学员的素材\头像图片\16.bmp
文件 1080 2007-06-19 10:58 C#完美仿QQ聊天软件MyQQ源代码(北大青鸟完整版)\提供给学员的素材\头像图片\17-1.bmp
文件 4856 2007-06-19 11:02 C#完美仿QQ聊天软件MyQQ源代码(北大青鸟完整版)\提供给学员的素材\头像图片\17.bmp
文件 1080 2007-06-19 10:58 C#完美仿QQ聊天软件MyQQ源代码(北大青鸟完整版)\提供给学员的素材\头像图片\18-1.bmp
文件 4856 2007-06-19 11:02 C#完美仿QQ聊天软件MyQQ源代码(北大青鸟完整版)\提供给学员的素材\头像图片\18.bmp
文件 1080 2007-06-19 10:58 C#完美仿QQ聊天软件MyQQ源代码(北大青鸟完整版)\提供给学员的素材\头像图片\19-1.bmp
文件 4856 2007-06-19 11:02 C#完美仿QQ聊天软件MyQQ源代码(北大青鸟完整版)\提供给学员的素材\头像图片\19.bmp
文件 1080 2007-06-19 10:58 C#完美仿QQ聊天软件MyQQ源代码(北大青鸟完整版)\提供给学员的素材\头像图片\2-1.bmp
文件 4856 2007-06-19 11:02 C#完美仿QQ聊天软件MyQQ源代码(北大青鸟完整版)\提供给学员的素材\头像图片\2.bmp
............此处省略405个文件信息
- 上一篇:u013929746_7857119.zip
- 下一篇:中国矢量地图shape文件
相关资源
- u013929746_7857119.zip
- OPPO专用工具平台包.zip
- MapTest.zip
- paopao.rar
- VIVO售后解锁账号擦除软件和驱动平台
- eBatPrint13.2_crk破解版CAD批量打印PDF.r
-
Databa
seSystemConcepts6thEdition.pdf - KMSTools_V18.06.2016_Xitongzhijia.zip
- C7.0inaNutshellTheDefinitiveReference.pdf
- 米酷影视5.0修复综艺动漫.zip
- h1.bin
- u011296061_8888705.zip
- GirdDemo.zip
- ListDemo.zip
- u010837860_9188769.zip
- Envi5.1破解.rar
- IPC-7711B-7721B-Chinese(L).pdf
- ANSOFT_RMxprt用户手册V12(1-6章).pdf
- Optiwave.OptiSystem.v7.0.With.Crack-NULL.part3
- hctwifi_UTF8_1.3.zip
- 精通特征工程.pdf源码.zip
- splunk-7.2.3-06d57c595b80-Linux-x86_64_crack.t
- 最优化理论与算法(第2版).pdf
-
fr
ametest.rar - pdftoword0406.rar
- tifuqi7410_10684458.zip
- GBT32960相关资料.rar
- 微擎1.7.9.zip
- 统计信号处理基础-估计与检测理论
- 2778_Simplorer_v9_complete_manual.pdf
评论
共有 条评论