• 大小: 0.13M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2020-12-26
  • 语言: 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;

using System.Net;
using System.Net.Sockets;
using System.Threading;
using System.IO;

namespace 异步_client
{
    public partial class Form1 : Form
    {
        private Socket mySocket;
        public Form1()
        {
            InitializeComponent();
            Control.CheckForIllegalCrossThreadCalls = false;
        }

        private void ConnectServer(IAsyncResult ar)//一般普通函数都是通过事件处理函数调用的
        {
            Socket ss = (Socket)ar.AsyncState;
            try
            {
                ss.EndConnect(ar);//结束挂起的异步连接请求
                StreamReader sr = new StreamReader(

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-12-11 11:27  异步-client\
     文件         881  2018-12-11 11:27  异步-client\异步-client.sln
     文件       22016  2018-12-27 06:34  异步-client\异步-client.suo
     目录           0  2018-12-11 11:31  异步-client\异步-client\
     目录           0  2018-12-11 11:27  异步-client\异步-client\bin\
     目录           0  2018-12-11 11:27  异步-client\异步-client\bin\Debug\
     文件       14336  2018-12-27 06:23  异步-client\异步-client\bin\Debug\异步-client.exe
     文件       30208  2018-12-27 06:23  异步-client\异步-client\bin\Debug\异步-client.pdb
     文件       11600  2018-12-27 06:27  异步-client\异步-client\bin\Debug\异步-client.vshost.exe
     文件         490  2018-04-12 07:35  异步-client\异步-client\bin\Debug\异步-client.vshost.exe.manifest
     目录           0  2018-12-11 11:27  异步-client\异步-client\bin\Release\
     文件        3540  2018-12-15 08:23  异步-client\异步-client\Form1.cs
     文件        9472  2018-12-15 04:54  异步-client\异步-client\Form1.Designer.cs
     文件        5817  2018-12-15 04:54  异步-client\异步-client\Form1.resx
     目录           0  2018-12-11 11:27  异步-client\异步-client\obj\
     目录           0  2018-12-11 11:27  异步-client\异步-client\obj\x86\
     目录           0  2018-12-11 11:27  异步-client\异步-client\obj\x86\Debug\
     文件        6158  2018-12-15 04:48  异步-client\异步-client\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache
     文件        6447  2018-12-27 06:23  异步-client\异步-client\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache
     目录           0  2018-12-11 11:27  异步-client\异步-client\obj\x86\Debug\TempPE\
     文件        1042  2018-12-27 06:27  异步-client\异步-client\obj\x86\Debug\异步-client.csproj.FileListAbsolute.txt
     文件         975  2018-12-15 04:54  异步-client\异步-client\obj\x86\Debug\异步-client.csproj.GenerateResource.Cache
     文件        9214  2018-12-27 06:22  异步-client\异步-client\obj\x86\Debug\异步-client.csprojResolveAssemblyReference.cache
     文件       14336  2018-12-27 06:23  异步-client\异步-client\obj\x86\Debug\异步-client.exe
     文件       30208  2018-12-27 06:23  异步-client\异步-client\obj\x86\Debug\异步-client.pdb
     文件         180  2018-12-15 04:54  异步-client\异步-client\obj\x86\Debug\异步_client.Form1.resources
     文件         180  2018-12-15 04:47  异步-client\异步-client\obj\x86\Debug\异步_client.Properties.Resources.resources
     文件         494  2018-12-11 11:27  异步-client\异步-client\Program.cs
     目录           0  2018-12-11 11:27  异步-client\异步-client\Properties\
     文件        1358  2018-12-11 11:27  异步-client\异步-client\Properties\AssemblyInfo.cs
     文件        2878  2018-12-11 11:27  异步-client\异步-client\Properties\Resources.Designer.cs
............此处省略45个文件信息

评论

共有 条评论