如何在项目中添加DLL.

如何在项目中添加DLL.

问题描述:

如何在project.my dll包含的文件中添加DLL.

how to add DLL in project.my dll contains.

public class MyClass1
   {
       public static string MyHelloMethod()
       {
           return "Hello World";
       }

   }


我希望它在项目中使用以显示在label.how中吗?


and i want it to use in project to display in label.how to do it?

使用添加引用添加DLL文件并在项目中使用以下代码

Add your DLL file using Add Reference and use below code in your Project

using DllCreate;  // Namespace of your dll

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Label1.Text = Myclass1.MyHelloMethod();

    }
}


要创建程序集,您需要创建一个项目类库项目.在这个项目中,您将创建您的reportclass.vb类文件.构建此文件时,它将生成DLL文件.不幸的是,您无法在这种类型的项目中创建网页.
现在要在您的网站中使用它,您可以添加对此类库项目的项目引用,也可以添加对其生成的DLL的文件引用.
http://forums.asp.net/t/1281911.aspx/1 [ ^ ]
To create an assembly you will need to create a project class library project. In this project you will create your reportclass.vb class file. When you build this it will produce the DLL file. Unfortuantely you cannot create web pages in this type of project.
Now to use this in your website you can either add a project reference to this class library project, or add a file reference to the DLL it produced.
http://forums.asp.net/t/1281911.aspx/1[^]


嗨raj_sagoo ,
这是用于在项目中创建和添加Dll的视频链接.
点击此处
Hi raj_sagoo,
Here is the video link for creating and adding Dll in the project.
Click Here