我可以替代名称库吗?属性的DllImport参数
例如:
现在
[DllImport("First.dll")]
public static extern bool Info([MarshalAs(UnmanagedType.BStr)] ref string result);
想
private static string dllName = "Second.dll"
[DllImport(dllName)]
public static extern bool Info([MarshalAs(UnmanagedType.BStr)] ref string result);
您测试了吗?您可以通过尝试几秒钟找到答案。 –