All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
在C#中调用视图
AJAX的跨域名访问_[AJAX教程]
asp.net定制简单的错误处理页面_.net资料_编程技术
xml文件调用css_.net资料_编程技术
无废话C#设计模式之四:Factory,Method_.net资料_编程技术
两个SQL,Server维护技巧_[SQL,Server教程]
技巧:ASP.NET,2.0防止同一用户同时登陆_.net资料_编程技术
用PHP将整个网站生成HTML_php资料_编程技术
利用ICallbackEventHandle实现类似AJAX的无刷新页面_[Asp.Net教程]
比较SQL,Server,2000,数据库中两个库的差异_[SQL,Server教程]
Reading number is top 10 pictures
美奂绝伦的风景
湖南中医院的养生八图
日本小萝莉2
Summer is most suitable for young people to travel in China3
Chinese paper-cut grilles art appreciation2
007 James. bond's new lover
Discharge accidentally Actresses by the breast4
一个武林高手的故事
美女就是美女
泳装名模阿尔贝特妮写真2
Download software ranking
Sora aoi 120 minutes
Unix video tutorial8
传奇私服架设教程-chm
VC++6.0简体中文版
Kung fu panda - the secret of the teacher
Tram sex maniac 2 (H) rar bag16
C#编程思想
Tram sex maniac 2 (H) rar bag1
天龙八部十二宫服务端
虚拟机5.5.3版
qq published in(发表于) 2014/7/11 9:23:24 Edit(编辑)
C#教程:创建DLL动态链接库

C#教程:创建DLL动态链接库

C#教程:创建DLL动态链接库

创建DLL动态链接库

创建DLL动态链接库与创建其他Windows应用程序一样,创建DLL链接库的操作步骤如下所示。

(1)在集成开发环境Visual Studio 2005中,选择“文件”/“新建”/“项目”选项,弹出“新建项目”窗体。

(2)在“新建项目”窗体中,选择“类库”项,并设置类库名称及文件存放位置,如图1所示。

(3)设置完成后,单击【确定】按钮,生成代码如下所示:

using System;

using System.Collections.Generic;

using System.Text;

namespace ClassLibrary1

{

public class Class1

{

}

}

示例

简单的加、减、乘、除运算类库

编写相关的运算方法,在菜单中选择“生成”“生成”,进行编译,如果没有出现问题,类库编译成功。代码如下。

using System;

using System.Collections.Generic;

using System.Text;

namespace _4_01

{

public class Operation

{

public double Add(double a, double b)

{

return a + b;

}

public double Minus(double a, double b)

{

return a - b;

}

public double Multiplication(double a, double b)

{

return a * b;

}

public double Division(double a, double b)

{

return a / b;

}

}

}

完整程序代码如下:

★ ★★★★Operation.cs公共类文件完整程序代码★★★★★

using System;

using System.Collections.Generic;

using System.Text;

namespace _4_01

{

public class Operation

{

public double Add(double a, double b)

{

return a + b;

}

public double Minus(double a, double b)

{

return a - b;

}

public double Multiplication(double a, double b)

{

return a * b;

}

public double Division(double a, double b)

{

return a / b;

}

}

}



图1 选择“类库”项目




添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.