資源簡介
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 源碼
- 下一篇:數據庫實驗人事管理系統
評論
共有 條評論