我是C#.NET的新手.我正在编写一个方法,我需要调用并运行DLL文件,其中DLL文件名来自String变量 -
String[] spl;
String DLLfile = spl[0];
Run Code Online (Sandbox Code Playgroud)
如何导入此DLL并从DLL调用函数以获取返回值?我尝试了以下方式..
String DLLfile = "MyDLL.dll";
[DllImport(DLLfile, CallingConvention = CallingConvention.StdCall)]
Run Code Online (Sandbox Code Playgroud)
但它没有用,因为字符串应该是'const string'类型而'const string'不支持变量.请帮我详细说明一下程序.谢谢.