在Windows C#中使用Dll [英] Use of Dll in windows c#

查看:92
本文介绍了在Windows C#中使用Dll的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好...


我开始在Windows应用程序中玩dll.

我知道我们在c#应用程序中使用[DllImport]属性来使用Windows dll.
但是我不知道我可以使用的dll里面的方法是什么..也不知道哪个dll是出于什么目的.

因此,有什么方法可以在dll旁边搜索方法列表,以便我们可以知道哪个dll对我们有用.
或任何dll及其说明的列表

我还尝试在我的可视Web开发人员中引用Windows32-cards.dll文件.但它否认了..

Web和Windows的dll是否不同?
我们不能在Web应用程序中引用Windows dll吗?

请指导我该怎么办?

问候

Hello everyone...


Hi I started to play with dlls in my windows application.

I know we use [DllImport] attribute in c# application to use the windows dll.
But I don''t know what are the method inside the dll that I can use.. neither know which dll is for what purpose.

So is there any way to seek the methods list in side the dll so we can come to know which dll is useful for us.
Or any list of dll with their description

And I also tried to reference windows32 -- cards.dll file in my visual web developer. but it denied..

Are the dlls different for web and windows?
Can''t we reference windows dll in web application?

Please guide me what best should I do?

Regards

推荐答案

dll将具有一些公开给客户端的公共方法.
这些是您将能够使用的.

检查是否有任何文档可以查阅.
像OLE Viewer这样的工具也可以为您提供帮助.
A dll would have some public methods that would have been exposed to a client.
These are the ones that you will be able to use.

Check if there is any documentation that you could consult.
A tool like the OLE Viewer could also help you.


要添加到Abhinav的答案中,您可以使用名为 ^ ].它将向您显示非托管DLL中公开的方法和类.
To add to Abhinav''s answer, you could use a free utility called Dependency Walker[^]. It will show you exposed methods and classes in an unmanaged DLL.


您可以获取依赖关系,还可以获取导出列表,仅此而已.您无法获得有关导出函数功能的任何信息.您可以了解到每种方法的预期参数是使用名称修饰(( http://en.wikipedia.org/wiki/Name_decoration [ ^ ]),但这不是100%可靠的.因此,要使用它,您确实需要一些文档.

除了Dependency Walker,您还可能需要使用某些二进制转储工具,例如dumpbin.exe,该工具已与所有版本的Visual Studio捆绑在一起.您可以通过Visual Studio命令提示符使用if.

—SA
You can get dependency and you can get a list of exports, that''s pretty much it. You cannot get any information on what exported functions do. You can get some hint of what are expected parameters of each method is name mangling is used (http://en.wikipedia.org/wiki/Name_decoration[^]), but this is not 100% reliable. So, to be able to use it you really need some documentation.

In addition to Dependency Walker, you also may need to use some binary dump tool, such as dumpbin.exe, which is bundled with all versions of Visual Studio. You can use if via Visual Studio Command Prompt.

—SA


这篇关于在Windows C#中使用Dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆