zoukankan      html  css  js  c++  java
  • 调用c++接口类

    调用c++接口类

     public class CarDeviceDll
        {
            /*对dll库进行一些初始化*/
            [DllImport("IDI.dll")]
            public static extern int Init_IDI(string IP, int port);
    
            [DllImport("IDI.dll")]
            public static extern int Connect_IDI(string IP, int port);
    
            /*由客户端定时向服务器发送命令,检测连接状态*/
            [DllImport("IDI.dll")]
            public static extern void HeartBeat_IDI();
    
            /*从服务端接受数据*/
            [DllImport("IDI.dll")]
            public static extern int Recv_IDI(ref Client_Data rec);
    
            [DllImport("IDI.dll")]
            public static extern int QuideInfo_Check(byte DoorNo);
    
    
            [DllImport("IDI.dll")]
            public static extern int GetPic_From_Server_IDI(byte[] name, byte[] pic, int len);
    
            [DllImport("IDI.dll")]
            public static extern int GetPerson_From_Server_IDI(byte[] name, byte[] pic, int len);
    
            [DllImport("IDI.dll")]
            public static extern int Send_IDI(string sed,int iLen);
            [StructLayout(LayoutKind.Sequential, Pack = 1)]
            public struct Client_Data_Head 
            {
                public UInt16 wHeader;
                public int iReserved;
                public byte byCommand;
                public  UInt16 wDataLen;
            }
    
    
            [StructLayout(LayoutKind.Sequential, Pack = 1)]
            public struct Client_Data
            {
                public UInt16 wHeader;
                public int iReserved;
                public byte byCommand;
                public UInt16 wDataLen;
                
                [MarshalAs(UnmanagedType.ByValTStr,SizeConst=160)]
                public string szData;
            }
    
            [StructLayout(LayoutKind.Sequential, Pack = 1)]
            public struct PClientData
            {
                public UInt16 wHeader;
                public int iReserved;
                public byte byCommand;
                public UInt16 wDataLen;
                
                [MarshalAs(UnmanagedType.ByValTStr,SizeConst=160)]
                public string szData;
            }
    
        }
  • 相关阅读:
    洛谷P1455 搭配购买(并查集)
    洛谷 P2078 朋友(并查集)
    TheZealous的集训日常之 离线算法与在线算法区别
    综合练习: Python自动化测试--从Excel读取数据并录入mysql
    读取excel/CSV/json数据
    Python 日志
    python 操作数据库
    python requests 接口: 调用百度开发者平台图片文字识别接口
    接口测试理论 2
    接口测试理论 1
  • 原文地址:https://www.cnblogs.com/markli/p/3581946.html
Copyright © 2011-2022 走看看