이름 라이브러리 대신 매개 변수를 대체 할 수 있습니까? 예를 들어속성의 DllImport 매개 변수
:
지금
[DllImport("First.dll")]
public static extern bool Info([MarshalAs(UnmanagedType.BStr)] ref string result);
당신은 const를하지만 변수를 사용할 수 있습니다
private static string dllName = "Second.dll"
[DllImport(dllName)]
public static extern bool Info([MarshalAs(UnmanagedType.BStr)] ref string result);
테스트 해 보셨습니까? 몇 초 후에 답을 찾을 수 있습니다. –