File.Client/FormClient.cs

(开头部分) 13KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using HslCommunication;
using HslCommunication.Enthernet;
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;

namespace File.Client
{
    public partial class FormClient : Form
    {
        public FormClient()
        {
            InitializeComponent();
        }

        private void FormClient_Load(object sender, EventArgs e)
        {
            IntegrationFileClientInitialization();
        }


        #region 客户端核心引擎

        private IntegrationFileClient integrationFileClient;                 // 客户端的核心引擎

        private void IntegrationFileClientInitialization()
        {
            // 定义连接服务器的一些属性,超时时间,IP及端口信息
            integrationFileClient = new IntegrationFileClient()
            {
                ConnectTimeout = 5000,
                ServerIpEndPoint = new System.Net.IPEndPoint(System.Net.IPAddress.Parse("127.0.0.1"), 34567),
                KeyToken = new Guid("A8826745-84E1-4ED4-AE2E-D3D70A9725B5")                                         // 指定一个令牌
            };

            // 创建本地文件存储的路径
            string path = Application.StartupPath + @"\Files";
            if (!System.IO.Directory.Exists(path))
            {
                System.IO.Directory.CreateDirectory(path);
            }
        }

        #endregion

        #region 上传文件块


        /*************************************************************************************************
         * 
         *   一条指令即可完成文件的上传操作,上传模式有三种
         *   1. 指定本地的完整路径的文件名
         *   2. 将流(stream)中的数据上传到服务器
         *   3. 将bitmap图片数据上传到服务器
         * 
后面还有 263 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。