Dynamic link library The DLL is a short form of the dynamic link library, which is a library of code and data that can be used by multiple programs at the same time, helping to share data and resources.
(i) Creating a dynamic link library
1) Create a new class library
650) this.width=650; "Src=" http://images.cnitblog.com/blog/466760/201212/ 30220335-2ba8cd2648cf4226973e6bfb684ab411.jpg "/>
2) write this class library
For example:
Using system;using system.collections.generic;using system.linq;using system.text;using System.Threading.Tasks; Namespace dlltest{public class class1{public void ShowMessage () {Console.WriteLine ("Your Are success Ful to the call DLL. "); Console.ReadLine ();}}}
3) generate a dynamic link library
650) this.width=650; "Src=" http://images.cnitblog.com/blog/466760/201212/30220427- C32491972fb04eafb2ece1fcc245723f.jpg "/>
(ii) Use of dynamic link libraries
1) Add a console application--Add Reference
Right-click the project-Add reference-Browse to find the local DLL file
650) this.width=650; "width=" 182 "height=" "title=" image "style=" margin:0px;border:0px;padding-top:0px; Padding-right:0px;padding-left:0px;background-image:none; "alt=" image "src=" http://images.cnitblog.com/blog/ 466760/201212/30132816-541fa72e020e43239ef38315c6bad5e8.png "border=" 0 "/>
2) using the namespace of the code inside the DLL file
For example:
Using system;using system.collections.generic;using system.linq;using system.text;using System.Threading.Tasks; Using Dlltest;namespace test{class program{static void Main (string[] args) {Dlltest.class1 myTest = New Dlltest.class1 (); Mytest.showmessage ();}}}
Results:
You is successful to the call DLL.
Reference:
Http://www.cnblogs.com/hanzhaoxin/archive/2012/12/30/2839690.html
This article comes from the "Ricky's blog" blog, please be sure to keep this source http://57388.blog.51cto.com/47388/1656039
* C #-Create and use DLLs