• 大小: 0.28M
    文件类型: .rar
    金币: 2
    下载: 1 次
    发布日期: 2020-12-26
  • 语言: C#
  • 标签: Socket  C#  服务器  客户端  

资源简介

C# Socket 客户端服务器通信demo(附源码)

资源截图

代码片段和文件信息

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

namespace StriveEngine.SimpleDemo
{
    /*
     * 本客户端Demo直接基于.NET的Socket进行开发,其目的是为了演示:在客户端不使用StriveEngine的情况下,如何与基于StriveEngine的服务端进行通信。
     * 本客户端Demo只是粗糙地实现了基本目的,很多细节问题都被忽略,像粘包问题、消息重组、掉线检测等等。而这些问题在实际的应用中,是必需要处理的。(当然,StriveEngine中的客户端和服务端引擎都内置解决了这些问题)
     * 
     */
    public partial class Form1 : Form
    {
        private NetworkStream stream;
        private byte[] buffer = new byte[10240];
        public Form1()
        {
            InitializeComponent();
        }

        private void button3_Click(object sender EventArgs e)
        {
            try
          

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

     文件        600  2013-06-06 14:26  StriveEngine.SimpleDemo\Demo说明.txt

     文件     120320  2013-12-11 14:31  StriveEngine.SimpleDemo\Resources\StriveEngine.dll

     文件      62600  2013-11-03 11:17  StriveEngine.SimpleDemo\Resources\StriveEngine.xml

     文件      12800  2013-12-11 14:36  StriveEngine.SimpleDemo\StriveEngine.SimpleDemo\bin\Debug\StriveEngine.SimpleDemo.exe

     文件      32256  2013-12-11 14:36  StriveEngine.SimpleDemo\StriveEngine.SimpleDemo\bin\Debug\StriveEngine.SimpleDemo.pdb

     文件       3552  2013-06-02 10:32  StriveEngine.SimpleDemo\StriveEngine.SimpleDemo\Form1.cs

     文件       9305  2013-06-02 10:31  StriveEngine.SimpleDemo\StriveEngine.SimpleDemo\Form1.Designer.cs

     文件       5817  2013-06-02 10:31  StriveEngine.SimpleDemo\StriveEngine.SimpleDemo\Form1.resx

     文件       5431  2013-12-11 14:36  StriveEngine.SimpleDemo\StriveEngine.SimpleDemo\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache

     文件        864  2013-12-11 14:36  StriveEngine.SimpleDemo\StriveEngine.SimpleDemo\obj\x86\Debug\ResGen.read.1.tlog

     文件        978  2013-12-11 14:36  StriveEngine.SimpleDemo\StriveEngine.SimpleDemo\obj\x86\Debug\ResGen.write.1.tlog

     文件       3348  2013-12-11 14:36  StriveEngine.SimpleDemo\StriveEngine.SimpleDemo\obj\x86\Debug\StriveEngine.SimpleDemo.csproj.FileListAbsolute.txt

     文件      12800  2013-12-11 14:36  StriveEngine.SimpleDemo\StriveEngine.SimpleDemo\obj\x86\Debug\StriveEngine.SimpleDemo.exe

     文件        180  2013-12-11 14:36  StriveEngine.SimpleDemo\StriveEngine.SimpleDemo\obj\x86\Debug\StriveEngine.SimpleDemo.Form1.resources

     文件      32256  2013-12-11 14:36  StriveEngine.SimpleDemo\StriveEngine.SimpleDemo\obj\x86\Debug\StriveEngine.SimpleDemo.pdb

     文件        180  2013-12-11 14:36  StriveEngine.SimpleDemo\StriveEngine.SimpleDemo\obj\x86\Debug\StriveEngine.SimpleDemo.Properties.Resources.resources

     文件        484  2013-06-01 09:36  StriveEngine.SimpleDemo\StriveEngine.SimpleDemo\Program.cs

     文件       1396  2013-06-01 09:36  StriveEngine.SimpleDemo\StriveEngine.SimpleDemo\Properties\AssemblyInfo.cs

     文件       2894  2013-06-01 09:36  StriveEngine.SimpleDemo\StriveEngine.SimpleDemo\Properties\Resources.Designer.cs

     文件       5612  2013-06-01 09:36  StriveEngine.SimpleDemo\StriveEngine.SimpleDemo\Properties\Resources.resx

     文件       1106  2013-06-01 09:36  StriveEngine.SimpleDemo\StriveEngine.SimpleDemo\Properties\Settings.Designer.cs

     文件        249  2013-06-01 09:36  StriveEngine.SimpleDemo\StriveEngine.SimpleDemo\Properties\Settings.settings

     文件       3453  2013-06-01 11:08  StriveEngine.SimpleDemo\StriveEngine.SimpleDemo\StriveEngine.SimpleDemo.csproj

     文件       3625  2013-06-06 10:38  StriveEngine.SimpleDemo\StriveEngine.SimpleDemo.sln

    ..A..H.     48640  2013-12-11 14:37  StriveEngine.SimpleDemo\StriveEngine.SimpleDemo.suo

     文件     120320  2013-12-11 14:31  StriveEngine.SimpleDemo\StriveEngine.SimpleDemoClient\bin\Debug\StriveEngine.dll

     文件      13312  2013-12-11 14:36  StriveEngine.SimpleDemo\StriveEngine.SimpleDemoClient\bin\Debug\StriveEngine.SimpleDemoClient.exe

     文件      32256  2013-12-11 14:36  StriveEngine.SimpleDemo\StriveEngine.SimpleDemoClient\bin\Debug\StriveEngine.SimpleDemoClient.pdb

     文件      11608  2013-11-05 09:52  StriveEngine.SimpleDemo\StriveEngine.SimpleDemoClient\bin\Debug\StriveEngine.SimpleDemoClient.vshost.exe

     文件        490  2010-03-17 22:39  StriveEngine.SimpleDemo\StriveEngine.SimpleDemoClient\bin\Debug\StriveEngine.SimpleDemoClient.vshost.exe.manifest

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

评论

共有 条评论