• 大小: 0.03M
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2020-12-26
  • 语言: C#
  • 标签: Socket  下载  c  t  

资源简介

socket示例,方便大家下载使用。

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Text;

using System.Net;
using System.Net.Sockets; 

namespace Client
{
    class CClient
    {
        public string ReturnStr = ““;

        public void BeginSend()
        {

            string ip = “127.0.0.1“;

            string port = “8000“;
            
            //IPAddress serverIp = IPAddress.Parse(ip);
            IPAddress serverIp = GetServerIP();

            int serverPort = Convert.ToInt32(port);

            IPEndPoint iep = new IPEndPoint(serverIp serverPort);

            byte[] byteMessage;



            Socket socket = new Socket(AddressFamily.InterNetwork SocketType.Stream ProtocolType.Tcp);

            socket.Connect(iep);



            byteMessage = Encoding.D

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        907  2007-08-09 19:56  Socket\Server\Server.sln

    ..A..H.     15872  2008-06-07 16:16  Socket\Server\Server.suo

     文件       1047  2007-08-09 22:27  Socket\Server\Server\Form1.cs

     文件       3504  2007-08-09 22:27  Socket\Server\Server\Form1.Designer.cs

     文件       6008  2007-08-09 22:27  Socket\Server\Server\Form1.resx

     文件        465  2007-08-09 19:56  Socket\Server\Server\Program.cs

     文件       3257  2007-08-09 21:55  Socket\Server\Server\Server.csproj

     文件       2784  2008-06-07 14:20  Socket\Server\Server\CServer.cs

     文件       1176  2007-08-09 19:56  Socket\Server\Server\Properties\AssemblyInfo.cs

     文件       2866  2007-08-09 19:56  Socket\Server\Server\Properties\Resources.Designer.cs

     文件       5612  2007-08-09 19:56  Socket\Server\Server\Properties\Resources.resx

     文件       1089  2007-08-09 19:56  Socket\Server\Server\Properties\Settings.Designer.cs

     文件        249  2007-08-09 19:56  Socket\Server\Server\Properties\Settings.settings

     文件        261  2008-06-07 16:02  Socket\Server\Server\obj\Server.csproj.FileList.txt

     文件       3257  2007-08-09 22:11  Socket\Client\Client.csproj

     文件        900  2007-08-09 22:06  Socket\Client\Client.sln

    ..A..H.     27136  2008-06-07 15:47  Socket\Client\Client.suo

     文件        606  2007-11-23 15:28  Socket\Client\Form1.cs

     文件       2509  2007-11-23 15:28  Socket\Client\Form1.Designer.cs

     文件       5814  2007-11-23 15:28  Socket\Client\Form1.resx

     文件        465  2007-08-09 22:06  Socket\Client\Program.cs

     文件       1685  2008-06-07 14:17  Socket\Client\CClient.cs

     文件       1176  2007-08-09 22:06  Socket\Client\Properties\AssemblyInfo.cs

     文件       2866  2007-08-09 22:06  Socket\Client\Properties\Resources.Designer.cs

     文件       5612  2007-08-09 22:06  Socket\Client\Properties\Resources.resx

     文件       1089  2007-08-09 22:06  Socket\Client\Properties\Settings.Designer.cs

     文件        249  2007-08-09 22:06  Socket\Client\Properties\Settings.settings

     文件        261  2008-06-07 15:41  Socket\Client\obj\Client.csproj.FileList.txt

     目录          0  2008-06-12 11:49  Socket\Server\Server\obj\Debug

     目录          0  2008-06-12 11:49  Socket\Server\Server\bin\Debug

............此处省略16个文件信息

评论

共有 条评论