c#调用C++的dll的例程

    xiaoxiao2021-04-05  43

    

    using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Runtime.InteropServices;

    namespace TestSecond {     class Program     {         static void Main(string[] args)         {             while (true)             {                 //int count = DllManager.Func();                 int count = DllManager.GetValue(5);                 Console.WriteLine(count);             }         }     }

        public static class DllManager     {             [DllImport(@"E:\whh\数oy据Y健?康|ì检¨?测a仪°?软¨¨a件t\CommandInjection0329\CommandInjection0316\TestSecond\bin\Debug\NewAPI.dll", EntryPoint = "DisPlay",CallingConvention=CallingConvention.Cdecl)]//调ì??用??规?约?         public  static extern int GetValue(int num);         //public static int Func()         //{         //    int a=GetValue(4);         //    return a;         //}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             } }

    转载请注明原文地址: https://ju.6miu.com/read-666285.html

    最新回复(0)