托管DLL和非托管DLL有什么区别
我是新手......我真的很想知道两者之间的详细区别,以及何时使用它们?
I am a newbie....I would really like to know detailed difference between two, and when to use these?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
术语“托管代码”通常指用托管语言(例如 Java 或 C#)编写的代码。术语“非托管代码”通常指用非托管语言(例如 C 或 C++)编写的代码。如果您来自 .NET 世界,“托管”可能意味着 C# 或 VB.NET,“非托管”可能意味着 C 或 C++。
The term "managed code" usually refers to code written in a managed language, such as Java or C#. The term "unmanaged code" usually refers to code written in an unmanaged language, such as C or C++. If you're coming from the .NET world, "managed" probably means C# or VB.NET, and "unmanaged" probably means C or C++.
托管 dll 在公共语言运行时 (CLR) 内运行。因此它有很多好处,比如自动内存管理。非托管 dll 不会给您带来所有这些好处。
为了获得 .Net 的全部优势,请创建并使用托管代码。
Managed dll runs inside Common Language Runtime (CLR). Hence it gets several benefits like automatic memory management. Unmanaged dll won't give you all these benefits.
For reaping the full benefits of .Net, create and use managed code.