资源简介
chat.rar
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Net;
using System.Net.Sockets;
using System.Threading;
using System.Drawing.Text;
using System.IO;
namespace chat2._0
{
public partial class chat : Form
{
public Dictionary chatBuffer;//切换聊天对象时聊天记录缓存
private string UIfile = “Gray“;//指定主题颜色
private setUI setui;//设置主题颜色
private Point mousePoint = new Point();//提供窗体移动点
private Point formLocation;//窗口位置
private string userName;//自己的用户名
ImageList sendButton = null;//发送按钮的图片样式
//构造函数
public chat(string userName)
{
InitializeComponent();
dataProcessing.setChat(this);
this.userName = userName;
}
private void chat_Load(object sender EventArgs e)
{
sendButton = GrayButton;
chatBuffer = new Dictionary();
chatBuffer.Add(“公共聊天室“““);
//加载字体
//路径
string path = “.\\myFont.ttf“;
Font f = null;
Font chatFont = null;
if (File.Exists(path))
{
//读取字体文件
PrivateFontCollection pfc = new PrivateFontCollection();
pfc.AddFontFile(path);
//实例化字体
f = new Font(pfc.Families[0] 15);
chatFont = new Font(pfc.Families[0] 13);
}
else
{
f = new Font(“黑体“ 15);
chatFont = new Font(“黑体“ 13);
}
//设置字体
label10.Font = f;
label6.Font = f;
label1.Font = f;
label3.Font = f;
label3.ForeColor = Color.Red;
label7.Font = f;
listBox1.Font = f;
setui = new setUI(fthis);
label7.Text = “当前用户 : “+userName;
//调整各个控件位置
label10.Parent = pictureBox2;
label6.Parent = panel2;
label10.Location = new Point(pictureBox2.Width/2 - label10.Width/2pictureBox2.Height/2 - label10.Height/2);
label6.Location = new Point(panel2.Width / 2 - label6.Width / 2 panel2.Height / 2 - label6.Height / 2);
listBox1.SelectedIndex = 0;
//开始监听端口进行通信
if (!dataProcessing.beginWork(“chat“)) MessageBox.Show(“与服务器通信失败“);
//获得在线用户列表
dataProcessing.sendData(3 null);
}
public string getUserName()
{
return this.userName;
}
public void showMessageBox(string s)
{ MessageBox.Show(s); }
//添加聊天内容
public void addText(string locationstring s)//location: 属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 187 2018-05-19 16:02 chat\chat2.0\App.config
文件 908800 2018-06-16 16:33 chat\chat2.0\bin\Debug\chat2.0.exe
文件 187 2018-05-19 16:02 chat\chat2.0\bin\Debug\chat2.0.exe.config
文件 75264 2018-06-16 16:33 chat\chat2.0\bin\Debug\chat2.0.pdb
文件 22984 2018-06-16 16:32 chat\chat2.0\bin\Debug\chat2.0.vshost.exe
文件 187 2018-05-19 16:02 chat\chat2.0\bin\Debug\chat2.0.vshost.exe.config
文件 490 2018-04-12 07:35 chat\chat2.0\bin\Debug\chat2.0.vshost.exe.manifest
文件 3054032 2018-05-26 13:05 chat\chat2.0\bin\Debug\myFont.ttf
文件 15668 2018-06-15 14:21 chat\chat2.0\chat.cs
文件 18516 2018-06-12 11:30 chat\chat2.0\chat.Designer.cs
文件 1127796 2018-06-12 11:30 chat\chat2.0\chat.resx
文件 4459 2018-05-26 14:35 chat\chat2.0\chat2.0.csproj
文件 903 2018-05-19 16:02 chat\chat2.0\chat2.0.sln
..A..H. 53248 2018-06-16 16:33 chat\chat2.0\chat2.0.v11.suo
文件 8048 2018-06-16 16:33 chat\chat2.0\dataProcessing.cs
文件 13688 2018-06-16 16:32 chat\chat2.0\login.cs
文件 17258 2018-06-15 14:23 chat\chat2.0\login.Designer.cs
文件 189552 2018-06-15 14:23 chat\chat2.0\login.resx
文件 1288 2018-06-16 16:33 chat\chat2.0\obj\Debug\chat2.0.csproj.FileListAbsolute.txt
文件 1090 2018-06-16 16:33 chat\chat2.0\obj\Debug\chat2.0.csproj.GenerateResource.Cache
文件 908800 2018-06-16 16:33 chat\chat2.0\obj\Debug\chat2.0.exe
文件 75264 2018-06-16 16:33 chat\chat2.0\obj\Debug\chat2.0.pdb
文件 747895 2018-06-16 16:33 chat\chat2.0\obj\Debug\chat2._0.chat.resources
文件 122739 2018-06-16 16:33 chat\chat2.0\obj\Debug\chat2._0.login.resources
文件 180 2018-06-16 16:33 chat\chat2.0\obj\Debug\chat2._0.Properties.Resources.resources
文件 180 2018-06-16 16:33 chat\chat2.0\obj\Debug\chat2._0.setUI.resources
文件 1451 2018-06-12 10:04 chat\chat2.0\obj\Debug\DesignTimeResolveAssemblyReferences.cache
文件 6923 2018-06-16 16:30 chat\chat2.0\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
文件 0 2018-05-19 16:02 chat\chat2.0\obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
文件 0 2018-05-19 16:02 chat\chat2.0\obj\Debug\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
............此处省略71个文件信息
- 上一篇:imagej 源码
- 下一篇:数据库实验人事管理系统
相关资源
- PID_AutoTune_v0.rar
- vspd7.2.308.zip
- 价值2k的H漫画小说系统
- Pythonamp;课堂amp;笔记(高淇amp;400;集第
- ddos压力测试工具99657
- UML建模大全
- 开源1A锂电池充电板TP4056原理图+PCB
- m1卡 ic卡可选择扇区初始化加密软件
- TSCC.exe
- FTP课程设计(服务端+客户端)
- 计算机图形学 边填充算法实现代码
- 电力系统潮流计算程序集合
- oracle数据迁移项目实施方案
- Web Api 通过文件流 文件到本地
- Visio图标-最新最全的网络通信图标库
- Spire API文档
- OpenGL参考手册
- Python中Numpy库最新教程
- SPD博士V5.3.exe
- 直流无刷电机方波驱动 stm32 例程代码
- layui后台管理模板
- 仿知乎界面小程序源代码
- 云平台-阿里云详细介绍
- photoshop经典1000例
- scratch垃圾分类源码(最终版本).sb
- IAR ARM 7.8破解
- TI CCS V5.4 安装步骤及破解文件
- 松下plc FP-XH的驱动
- 局域网硬件信息收集工具
- 加快Windows XP操作系统开机速度
川公网安备 51152502000135号
评论
共有 条评论