这里 DllImport 的用法有什么区别?具体来说,“user32”只是表示“user32.dll”,还是表示“user32.lib”或其他什么?
[DllImport("user32")]
protected static extern int GetKeyboardState(byte[] pbKeyState);
[DllImport("user32.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)]
protected static extern short GetKeyState(int vKey);
您可能可以忽略 CharSet 和 CallingConvention。
如果它们相同,我可以重写它以使其更加一致,但如果不是,我不想有一堆问题。