• 大小: 2.43M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2025-04-21
  • 语言: C#
  • 标签: DotNet  test  NET  d  

资源简介


资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;

namespace QtDllTestDotNET
{
    public partial class frmMain : Form
    {
        public frmMain()
        {
            InitializeComponent();
        }

        void MSG(string msg)
        {
            lboxMSG.Items.Add(msg + “ 时间:“ + DateTime.Now.ToString(“yyyy-MM-dd HH:mm:ss“));
        }        

        [DllImport(“HT110BServer.dll“)]
        static extern bool InitServer(int port);

        [DllImport(“HT110BServer.dll“)]
        static extern void CloseServer();

        [DllImport(“HT110BServer.dll“)]
        static extern void BuFang(string hostID byte[] data);

        [DllImport(“HT110BServer.dll“)]
        static extern void CheFang(string hostID byte[] data); 

        [UnmanagedFunctionPointer(CallingConvention.Winapi)]
        delegate void CallBackHostConnect(string hostID);

        [DllImport(“HT110BServer.dll“)]
        static extern void HostConnect([MarshalAs(UnmanagedType.FunctionPtr)] CallBackHostConnect CallBack);
        CallBackHostConnect cOnEventHostConnect = null;
        void OnEventHostConnect(string hostID)
        {
            MSG(“主机上线:“ + hostID);
            cboxHostID.Items.Add(hostID);
            cboxHostID.SelectedIndex = 0;
        }

        [UnmanagedFunctionPointer(CallingConvention.Winapi)]
        delegate void CallBackHostDisConnect(string hostID);

        [DllImport(“HT110BServer.dll“)]
        static extern void HostDisConnect([MarshalAs(UnmanagedType.FunctionPtr)] CallBackHostDisConnect CallBack);
        CallBackHostDisConnect cOnEventHostDisConnect = null;
        void OnEventHostDisConnect(string hostID)
        {
            MSG(“主机下线:“ + hostID);
            cboxHostID.Items.Remove(hostID);
        }

        [UnmanagedFunctionPointer(CallingConvention.Winapi)]
        delegate void CallBackHostBuFang(string hostID);

        [DllImport(“HT110BServer.dll“)]
        static extern void HostBuFang([MarshalAs(UnmanagedType.FunctionPtr)] CallBackHostBuFang CallBack);
        CallBackHostBuFang cOnEventHostBuFang = null;
        void OnEventHostBuFang(string hostID)
        {
            MSG(“主机布防:“ + hostID);
        }

        [UnmanagedFunctionPointer(CallingConvention.Winapi)]
        delegate void CallBackHostCheFang(string hostID);

        [DllImport(“HT110BServer.dll“)]
        static extern void HostCheFang([MarshalAs(UnmanagedType.FunctionPtr)] CallBackHostCheFang CallBack);
        CallBackHostCheFang cOnEventHostCheFang = null;
        void OnEventHostCheFang(string hostID)
        {
            MSG(“主机撤防:“ + hostID);
        }

        [UnmanagedFunctionPointer(CallingConvention.Winapi)]
        delegate void CallBackHostAlarm(string hostID string defenceID);

        [DllImport(“HT110BServer.d

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2014-05-21 15:21  QtDllTestDotNET\
     目录           0  2014-05-21 15:21  QtDllTestDotNET\QtDllTestDotNET\
     文件         934  2014-05-11 21:09  QtDllTestDotNET\QtDllTestDotNET.sln
     文件       15872  2014-06-19 11:39  QtDllTestDotNET\QtDllTestDotNET.suo
     目录           0  2014-05-21 15:21  QtDllTestDotNET\QtDllTestDotNET\bin\
     目录           0  2014-05-21 15:21  QtDllTestDotNET\QtDllTestDotNET\bin\Debug\
     目录           0  2014-05-21 15:21  QtDllTestDotNET\QtDllTestDotNET\bin\Release\
     文件     2449408  2014-05-20 10:02  QtDllTestDotNET\QtDllTestDotNET\bin\Release\HT110BServer.dll
     文件      212992  2014-05-20 11:37  QtDllTestDotNET\QtDllTestDotNET\bin\Release\QtDllTestDotNET.exe
     文件       28160  2014-05-20 11:37  QtDllTestDotNET\QtDllTestDotNET\bin\Release\QtDllTestDotNET.pdb
     文件        5632  2005-12-08 14:51  QtDllTestDotNET\QtDllTestDotNET\bin\Release\QtDllTestDotNET.vshost.exe
     文件        5030  2014-05-20 11:35  QtDllTestDotNET\QtDllTestDotNET\frmMain.cs
     文件        9399  2014-05-20 11:35  QtDllTestDotNET\QtDllTestDotNET\frmMain.Designer.cs
     文件      145398  2014-05-20 11:35  QtDllTestDotNET\QtDllTestDotNET\frmMain.resx
     文件       92854  2014-05-20 11:35  QtDllTestDotNET\QtDllTestDotNET\ICO201351.ico
     目录           0  2014-05-21 15:21  QtDllTestDotNET\QtDllTestDotNET\obj\
     目录           0  2014-05-21 15:21  QtDllTestDotNET\QtDllTestDotNET\obj\Debug\
     文件         842  2014-05-11 21:26  QtDllTestDotNET\QtDllTestDotNET\obj\Debug\QtDllTestDotNET.csproj.GenerateResource.Cache
     文件       20480  2014-05-11 21:29  QtDllTestDotNET\QtDllTestDotNET\obj\Debug\QtDllTestDotNET.exe
     文件         180  2014-05-11 21:26  QtDllTestDotNET\QtDllTestDotNET\obj\Debug\QtDllTestDotNET.Form1.resources
     文件       24064  2014-05-11 21:29  QtDllTestDotNET\QtDllTestDotNET\obj\Debug\QtDllTestDotNET.pdb
     文件         180  2014-05-11 21:24  QtDllTestDotNET\QtDllTestDotNET\obj\Debug\QtDllTestDotNET.Properties.Resources.resources
     目录           0  2014-05-21 15:21  QtDllTestDotNET\QtDllTestDotNET\obj\Debug\TempPE\
     文件        1390  2014-06-19 11:38  QtDllTestDotNET\QtDllTestDotNET\obj\QtDllTestDotNET.csproj.FileListAbsolute.txt
     目录           0  2014-05-21 15:21  QtDllTestDotNET\QtDllTestDotNET\obj\Release\
     文件         902  2014-05-20 11:35  QtDllTestDotNET\QtDllTestDotNET\obj\Release\QtDllTestDotNET.csproj.GenerateResource.Cache
     文件      212992  2014-05-20 11:37  QtDllTestDotNET\QtDllTestDotNET\obj\Release\QtDllTestDotNET.exe
     文件       93420  2014-05-20 11:35  QtDllTestDotNET\QtDllTestDotNET\obj\Release\QtDllTestDotNET.frmMain.resources
     文件       28160  2014-05-20 11:37  QtDllTestDotNET\QtDllTestDotNET\obj\Release\QtDllTestDotNET.pdb
     文件         180  2014-05-11 21:30  QtDllTestDotNET\QtDllTestDotNET\obj\Release\QtDllTestDotNET.Properties.Resources.resources
     目录           0  2014-05-21 15:21  QtDllTestDotNET\QtDllTestDotNET\obj\Release\Refactor\
............此处省略9个文件信息

评论

共有 条评论