• 大小: 0.21M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2020-12-14
  • 语言: C#
  • 标签: 网络  

资源简介

用socket 实现简单聊天室功能

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace SocketClient
{
    public partial class Form1 : Form
    {
        Socket client;
        public Form1()
        {
            InitializeComponent();
        }

        private void btnConnect_Click(object sender EventArgs e)
        {
            int port = int.Parse(tbPort.Text);
            IPAddress ipaddress = IPAddress.Parse(tbIP.Text);
            IPEndPoint endpoint = new IPEndPoint(ipaddress port);

            if (client == null)
            {
                

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2013-01-19 12:08  网络编程\
     目录           0  2013-01-19 18:28  网络编程\SocketClient\
     文件         187  2013-01-19 12:08  网络编程\SocketClient\App.config
     目录           0  2013-01-19 12:08  网络编程\SocketClient\bin\
     目录           0  2013-01-19 19:11  网络编程\SocketClient\bin\Debug\
     文件       12288  2013-01-19 19:14  网络编程\SocketClient\bin\Debug\SocketClient.exe
     文件         187  2013-01-19 12:08  网络编程\SocketClient\bin\Debug\SocketClient.exe.config
     文件       30208  2013-01-19 19:14  网络编程\SocketClient\bin\Debug\SocketClient.pdb
     文件       22984  2013-01-19 19:15  网络编程\SocketClient\bin\Debug\SocketClient.vshost.exe
     文件         187  2013-01-19 12:08  网络编程\SocketClient\bin\Debug\SocketClient.vshost.exe.config
     文件         490  2012-06-02 22:34  网络编程\SocketClient\bin\Debug\SocketClient.vshost.exe.manifest
     文件        4278  2013-01-19 19:15  网络编程\SocketClient\Form1.cs
     文件        6298  2013-01-19 18:59  网络编程\SocketClient\Form1.Designer.cs
     文件        5817  2013-01-19 18:59  网络编程\SocketClient\Form1.resx
     目录           0  2013-01-19 12:08  网络编程\SocketClient\obj\
     目录           0  2013-01-19 19:11  网络编程\SocketClient\obj\Debug\
     文件        7007  2013-01-19 18:28  网络编程\SocketClient\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
     文件         704  2013-01-19 19:15  网络编程\SocketClient\obj\Debug\SocketClient.csproj.FileListAbsolute.txt
     文件         975  2013-01-19 19:11  网络编程\SocketClient\obj\Debug\SocketClient.csproj.GenerateResource.Cache
     文件       12288  2013-01-19 19:14  网络编程\SocketClient\obj\Debug\SocketClient.exe
     文件         180  2013-01-19 19:11  网络编程\SocketClient\obj\Debug\SocketClient.Form1.resources
     文件       30208  2013-01-19 19:14  网络编程\SocketClient\obj\Debug\SocketClient.pdb
     文件         180  2013-01-19 19:11  网络编程\SocketClient\obj\Debug\SocketClient.Properties.Resources.resources
     文件           0  2013-01-19 12:08  网络编程\SocketClient\obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
     文件           0  2013-01-19 12:08  网络编程\SocketClient\obj\Debug\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
     文件           0  2013-01-19 12:08  网络编程\SocketClient\obj\Debug\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
     目录           0  2013-01-19 12:08  网络编程\SocketClient\obj\Debug\TempPE\
     文件         524  2013-01-19 12:08  网络编程\SocketClient\Program.cs
     目录           0  2013-01-19 12:08  网络编程\SocketClient\Properties\
     文件        1344  2013-01-19 12:08  网络编程\SocketClient\Properties\AssemblyInfo.cs
     文件        2876  2013-01-19 12:08  网络编程\SocketClient\Properties\Resources.Designer.cs
............此处省略109个文件信息

评论

共有 条评论