Using “C” dll in C# [duplicate]

老子叫甜甜 提交于 2020-01-25 04:34:28

问题


Possible Duplicate:
How do I call unmanaged C/C++ code from a C# ASP.NET webpage

I have a dll file that is written in "C" language, i want to use it in C#. How can i do that?


回答1:


You can use PInvoke

Platform Invocation Services (PInvoke) allows managed code to call unmanaged functions that are implemented in a DLL.

Here is a great tutorial by the NAG (Numerical Algorithms Group) group




回答2:


You can do a DllImport in your C# code and then use PInvoke.

For your custom dll you can try this example answer on SO.

This a good website for reference for using windows dlls



来源:https://stackoverflow.com/questions/4941736/using-c-dll-in-c-sharp

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!