Pinvoke如何运作?

Pinvoke如何运作?

问题描述:

我已经阅读了很多关于平台调用的内容并希望了解我的知识。

我认为:

1. Pinvoke包装任何Windows API,.dll文件。 />
2.然后我可以在我的C#程序中使用那些包装的API或.dll文件。

对吗?

I have read much about Platform Invoke and wanna check out my knowledge.
I think:
1. Pinvoke wraps any Windows API, .dll files.
2. Then i can use those wrapped APIs or .dll files in my C# program.
Right?

我已经解释了它是如何工作的,并为您提供了所有文档的链接。你为什么再次提出同样的问题?



1. P / Invoke是一种从托管(.NET)访问Windows(或任何其他)非托管代​​码的方法可以通过P / Invoke机制在.NET程序中使用任何Windows API。
I have explained how this works and given you links to all the documentation for it. Why are you asking the same question again?

1. P/Invoke is a way of accessing Windows (or any other) unmanaged code, from managed (.NET) applications.
2. You can use any Windows API in a .NET program via the P/Invoke mechanism.