2

C#的基于.net framework的Dll模块编程(五) - 编程手把手系列文章 - lzhdim

 4 months ago
source link: https://www.cnblogs.com/lzhdim/p/18148913
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

C#的基于.net framework的Dll模块编程(五)

       这次继续这个系列的介绍:

  一、使用DLL类库的方法;

  1) 静态类;

  先引用该类库,然后声明命名空间,然后就能够进行使用了。

   

o_240421062507_1.png

   

o_240421062528_2.png

  2) 动态类;

  先引用该类库,然后声明命名空间,然后能够进行使用了。

   

o_240421062528_2.png

  3) 窗体;

  只能在Winform里引用该类库,然后声明命名空间,然后就能够进行使用了。

   

o_240421062528_2.png

  二、使用其它C# DLL库的方法;

  使用其它C#的Dll库很简单,就是先引用该Dll文件类库,然后声明命名空间,然后就能够使用该类库里的内容了。

   

o_240421062528_2.png

  三、使用其它VC++的DLL方法;

  使用其它VC++的Dll,需要先声明该Dll里包含的函数的定义,然后才能够进行使用,这里提供一个例子,就是调用Windows提供的API函数,这里用一个静态类进行包装,然后进行调用。下面是一个例子,这里声明的是一个窗体动态效果的例子。

   

o_240421062537_4.png

   

o_240421062541_5.png

  这里提供例子下载:

  https://download.csdn.net/download/lzhdim/89193097

o_230607054137_lzhdim.png     Austin Liu  刘恒辉

Lzhdim Group's Chairman,Project Manager and Software Designer
    E-Mail:[email protected]
    Blog:https://lzhdim.cnblogs.com

欢迎收藏和转载此博客中的博文,但是请注明出处,给笔者一个与大家交流的空间。谢谢大家。

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK