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

资源简介

socket编程_tcp协议_Client

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Threading.Tasks;

namespace socket编程_tcp协议_Client
{
    class Program
    {
        static void Main(string[] args)
        {
            //[1]创建一个socket  
            Socket clientSocket = new Socket(AddressFamily.InterNetwork SocketType.Stream ProtocolType.Tcp);


            //[2]发起建立连接的请求  
            IPAddress ipAddress = IPAddress.Parse(“127.0.0.1“);//将一个字符串的ip转化为ipaddress的对象  
            IPEndPoint ipEndPoint = new IPEndPoint(ipAddress 9900);
            clientSocket.Connect(ipEndPoint);//通过ip:端口号 定位到一个要连接的服务器  
            //[3]接受从服务器端传来的数据  
            byte[] data = new byte[1024];
            int length = clie

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

     文件        187  2017-02-09 11:22  socket编程_tcp协议_Client\socket编程_tcp协议_Client\App.config

     文件       5632  2017-02-09 11:24  socket编程_tcp协议_Client\socket编程_tcp协议_Client\bin\Debug\socket编程_tcp协议_Client.exe

     文件        187  2017-02-09 11:22  socket编程_tcp协议_Client\socket编程_tcp协议_Client\bin\Debug\socket编程_tcp协议_Client.exe.config

     文件      11776  2017-02-09 11:24  socket编程_tcp协议_Client\socket编程_tcp协议_Client\bin\Debug\socket编程_tcp协议_Client.pdb

     文件      22984  2017-02-09 11:24  socket编程_tcp协议_Client\socket编程_tcp协议_Client\bin\Debug\socket编程_tcp协议_Client.vshost.exe

     文件        187  2017-02-09 11:22  socket编程_tcp协议_Client\socket编程_tcp协议_Client\bin\Debug\socket编程_tcp协议_Client.vshost.exe.config

     文件        490  2012-06-06 02:06  socket编程_tcp协议_Client\socket编程_tcp协议_Client\bin\Debug\socket编程_tcp协议_Client.vshost.exe.manifest

     文件       6655  2017-02-09 11:22  socket编程_tcp协议_Client\socket编程_tcp协议_Client\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache

     文件        592  2017-02-09 11:24  socket编程_tcp协议_Client\socket编程_tcp协议_Client\obj\Debug\socket编程_tcp协议_Client.csproj.FileListAbsolute.txt

     文件       5632  2017-02-09 11:24  socket编程_tcp协议_Client\socket编程_tcp协议_Client\obj\Debug\socket编程_tcp协议_Client.exe

     文件      11776  2017-02-09 11:24  socket编程_tcp协议_Client\socket编程_tcp协议_Client\obj\Debug\socket编程_tcp协议_Client.pdb

     文件          0  2017-02-09 11:22  socket编程_tcp协议_Client\socket编程_tcp协议_Client\obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs

     文件          0  2017-02-09 11:22  socket编程_tcp协议_Client\socket编程_tcp协议_Client\obj\Debug\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs

     文件          0  2017-02-09 11:22  socket编程_tcp协议_Client\socket编程_tcp协议_Client\obj\Debug\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs

     文件       1465  2017-02-09 11:23  socket编程_tcp协议_Client\socket编程_tcp协议_Client\Program.cs

     文件       1396  2017-02-09 11:22  socket编程_tcp协议_Client\socket编程_tcp协议_Client\Properties\AssemblyInfo.cs

     文件       2599  2017-02-09 11:22  socket编程_tcp协议_Client\socket编程_tcp协议_Client\socket编程_tcp协议_Client.csproj

     文件        977  2017-02-09 11:22  socket编程_tcp协议_Client\socket编程_tcp协议_Client.sln

    ..A..H.     64512  2017-02-09 11:24  socket编程_tcp协议_Client\socket编程_tcp协议_Client.v11.suo

     目录          0  2017-02-09 11:22  socket编程_tcp协议_Client\socket编程_tcp协议_Client\obj\Debug\TempPE

     目录          0  2017-02-09 11:24  socket编程_tcp协议_Client\socket编程_tcp协议_Client\bin\Debug

     目录          0  2017-02-09 11:24  socket编程_tcp协议_Client\socket编程_tcp协议_Client\obj\Debug

     目录          0  2017-02-09 11:22  socket编程_tcp协议_Client\socket编程_tcp协议_Client\bin

     目录          0  2017-02-09 11:22  socket编程_tcp协议_Client\socket编程_tcp协议_Client\obj

     目录          0  2017-02-09 11:22  socket编程_tcp协议_Client\socket编程_tcp协议_Client\Properties

     目录          0  2017-02-09 11:22  socket编程_tcp协议_Client\socket编程_tcp协议_Client

     目录          0  2017-02-09 11:22  socket编程_tcp协议_Client

----------- ---------  ---------- -----  ----

               137047                    27



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

评论

共有 条评论