• 大小: 0.09M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-03-27
  • 语言: C#
  • 标签: c#  

资源简介


聊天室 聊天室 聊天室 简单实现信息的交互

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace P2PClient
{
    public partial class Form1 : Form
    {
        P2PClient p2pClient = new P2PClient();
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender EventArgs e)
        {

        }

        private void btnConnect_Click(object sender EventArgs e)
        {
            //注册接收数据事件对应的方法,此方法将具体处理具体的数据接收事务
            p2pClient.TCPMsgArrived += new P2PClient.ArrivedMsgListened(p2pClient_TCPMsgArrived);
            //使用服务器IP和服务端口连接服务器
            p2pClient.SendConnection(txtIP.Text Convert.ToInt32(txtPort.Text));
            //向服务器发送连接昵称
            p2pClient.Send(txtName.Text+“登陆成功“);
        }

        void p2pClient_TCPMsgArrived(string receivedate)
        {
            if (this

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2010-10-09 10:41  P2P聊天室\
     目录           0  2010-10-09 10:42  P2P聊天室\P2PServer\
     目录           0  2010-10-23 08:58  P2P聊天室\P2PServer\P2PClient\
     目录           0  2010-10-09 10:42  P2P聊天室\P2PServer\P2PClient\bin\
     目录           0  2010-10-09 10:42  P2P聊天室\P2PServer\P2PClient\bin\Debug\
     文件       11776  2010-10-23 08:58  P2P聊天室\P2PServer\P2PClient\bin\Debug\P2PClient.exe
     文件       32256  2010-10-23 08:58  P2P聊天室\P2PServer\P2PClient\bin\Debug\P2PClient.pdb
     文件       14328  2010-10-23 09:08  P2P聊天室\P2PServer\P2PClient\bin\Debug\P2PClient.vshost.exe
     文件         490  2007-07-21 01:33  P2P聊天室\P2PServer\P2PClient\bin\Debug\P2PClient.vshost.exe.manifest
     文件        1722  2010-10-23 08:58  P2P聊天室\P2PServer\P2PClient\Form1.cs
     文件        7290  2010-09-05 10:42  P2P聊天室\P2PServer\P2PClient\Form1.Designer.cs
     文件        5814  2010-09-05 10:42  P2P聊天室\P2PServer\P2PClient\Form1.resx
     目录           0  2010-10-09 10:42  P2P聊天室\P2PServer\P2PClient\obj\
     目录           0  2010-10-23 08:58  P2P聊天室\P2PServer\P2PClient\obj\Debug\
     文件        1292  2010-10-23 09:08  P2P聊天室\P2PServer\P2PClient\obj\Debug\P2PClient.csproj.FileListAbsolute.txt
     文件         847  2010-10-23 08:58  P2P聊天室\P2PServer\P2PClient\obj\Debug\P2PClient.csproj.GenerateResource.Cache
     文件       11776  2010-10-23 08:58  P2P聊天室\P2PServer\P2PClient\obj\Debug\P2PClient.exe
     文件         180  2010-09-05 10:42  P2P聊天室\P2PServer\P2PClient\obj\Debug\P2PClient.Form1.resources
     文件       32256  2010-10-23 08:58  P2P聊天室\P2PServer\P2PClient\obj\Debug\P2PClient.pdb
     文件         180  2010-09-05 10:42  P2P聊天室\P2PServer\P2PClient\obj\Debug\P2PClient.Properties.Resources.resources
     目录           0  2010-10-09 10:42  P2P聊天室\P2PServer\P2PClient\obj\Debug\Refactor\
     目录           0  2010-10-09 10:42  P2P聊天室\P2PServer\P2PClient\obj\Debug\TempPE\
     文件        1843  2010-09-05 10:26  P2P聊天室\P2PServer\P2PClient\P2PClient.cs
     文件        3804  2010-09-05 10:32  P2P聊天室\P2PServer\P2PClient\P2PClient.csproj
     文件         490  2010-09-05 09:55  P2P聊天室\P2PServer\P2PClient\Program.cs
     目录           0  2010-10-09 10:42  P2P聊天室\P2PServer\P2PClient\Properties\
     文件        1374  2010-09-05 09:55  P2P聊天室\P2PServer\P2PClient\Properties\AssemblyInfo.cs
     文件        2868  2010-09-05 09:55  P2P聊天室\P2PServer\P2PClient\Properties\Resources.Designer.cs
     文件        5612  2010-09-05 09:55  P2P聊天室\P2PServer\P2PClient\Properties\Resources.resx
     文件        1094  2010-09-05 09:55  P2P聊天室\P2PServer\P2PClient\Properties\Settings.Designer.cs
     文件         249  2010-09-05 09:55  P2P聊天室\P2PServer\P2PClient\Properties\Settings.settings
............此处省略31个文件信息

评论

共有 条评论