如何在使用C#创建的程序中使用dll文件 [英] how to use a dll file in a program that create with c#

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

问题描述

我创建了一个dll文件,但无法在其他程序中使用它
请帮帮我吗?
thanx很多

i create a dll file but i cant how to use it in another program
please help me?
thanx a lot

推荐答案

在您的项目引用中添加该dll.之后,您可以在项目中使用该dll的类和方法.
Add that dll in references of your project. After that you can use classes and methods of that dll in your project.


添加.dll作为引用之后,需要将名称空间添加到自己的项目中(使用.foo.在文档顶部的foo中.)
After adding the .dll as an reference, you need to add the namespace to your own project (using.foo.foo on the top of your document).


在解决方案资源管理器中,右键单击项目"->添加引用"->.单击浏览并浏览ur Dll文件,然后单击确定.现在Dll已添加到ur Project.
为了访问任何方法或成员变量,您需要指定NamespaceName.ClassName.methodName
In solution Explorer right Click Project-->Add Reference--> Click Browse and browse for ur Dll File then click Ok. Now the Dll gets added to ur Project.
In order to access the any method or member varible u need to specify the NamespaceName.ClassName.methodName


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

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