我可以替代名稱庫嗎?屬性的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);
您測試了嗎?您可以通過嘗試幾秒鐘找到答案。 –