参考:https://blog.csdn.net/qq_41374107/article/details/106021015
参考:https://blog.csdn.net/guangod/article/details/85774225
namespace Dll2
{
class Program
{
[DllImport("Dll2.dll", EntryPoint = "myAdd", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
private static extern int Add(int a, int b);
[DllImport("Dll2.dll", EntryPoint = "myMax", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
private static extern int Max(int a, int b);
static void Main(string[] args)
{
Console.WriteLine(Add(1,2));
Console.WriteLine(Max(1,2));
Console.ReadKey();
}
}
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)