问题
Possible Duplicate:
Windows API and .net languages
I want to call native Windows API from .NET Framework. I want to have an easy way where I can call native API from high-level layer like other .NET APIs. Please refer to any resource which you know. Any help will be appreciated.
回答1:
You can use PInvoke in order to call Windows API functions.
There is also PInvoke Interop Assistant which generates a PInvoke signature of a function if you provide its Win32 signature.
回答2:
You can call unmanaged DLL's and other functions from the WinAPI using P/Invoke in C#. This link documents how to use a lot of these functions.
http://pinvoke.net/
来源:https://stackoverflow.com/questions/9032769/how-to-call-windows-api