c#调用非托管代码

using System.Runtime.InteropServices;

[DllImport("mydll.DLL", SetLastError = true)]//引用组件

private static extern bool MyModel(string myparents);//声明要调用的方法,extern 必须加上

private static test()

{

MYModel("");//调用 

}

原文地址:https://www.cnblogs.com/huangtailang/p/2445651.html