我如何将类文件转换为dll [英] how can i convert class file to dll

查看:103
本文介绍了我如何将类文件转换为dll的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我是新创建.net的dll的人.我的问题是我想将类文件转换为dll,以便将此类文件转换为另一个项目.我该怎么做.请任何人尽快回复.



hello everybody i am new for creating dlls in .net.what my problem is i want to convert class file to dll,for the shake of use this class file into another project. how can i do it. plz can any one give reply soon.



Thanks in advanced!

推荐答案


只需您可以从Visual Studio创建类库项目.
文件->新建->项目->类库
并编译它,并在要使用的任何地方使用它的dll文件.

也使用此链接..
http://gowrishaan.wordpress.com/2009 /05/22/how-to-make-class-cs-file-into-dll/ [
Hi,
simply you can create classlibrary project from visual studio.
file->new->project->class library
and compile it and use it''s dll file whereever you want to use.

Use this link also..
http://gowrishaan.wordpress.com/2009/05/22/how-to-make-class-cs-file-into-dll/[^]


第一个步骤:->在Microsoft Visual Studio文件->新建->项目


第二步:选择项目类型作为c#,模板将是类库


第三步:项目名称为classdll


第四步:检查您硬盘中的classdll位置,有一个文件夹名为bin-> debug->.在这里,只有您的类文件会转换为dll


第五步:您的文件名为class1.cs


第六步:首先添加您想要的库


第七步骤:->它显示错误(缺少程序集引用),您必须将一些库添加到


Project-> addreference-> .net(tab)添加您的dll文件…

八步:->
像这样
第九步:->您可以将.cs编码放入class1方法中
Frist Step:-> In Microsoft visual studio file->new->project


Second Step:-> choose project type as c# and template will be class libraries


Third Step:-> the project name was classdll


Fourth Step:-> check the classdll location in your hard disk, there is one folder name was bin->debug-> here only your class file will convert into dll


Fifth Step:-> your file name was class1.cs


Sixth Step:-> first add your libraries whatever you want


Seventh Step:-> it show the error (missing assembly reference) you have to add the some libraries move to


Project->addreference->.net(tab) add your dll files…

Eight Step:->
Above like this
Nineth Step:-> you can placed your .cs coding in the class1 method
public class Class1
{
public long Add(long val1)//don’t give the static method
{
return val1;
}
}


文章-[创建C#类库(DLL )使用Visual Studio .NET] [ ^ ]可能会对您有所帮助.
This article-[Creating C# Class Library (DLL) Using Visual Studio .NET][^] might help you.


这篇关于我如何将类文件转换为dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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