如何在项目中添加DLL. [英] how to add DLL in project.

查看:100
本文介绍了如何在项目中添加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


这篇关于如何在项目中添加DLL.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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