How to Create and Use the DLL

 

Q1. How to create a dll file in .net?

S1: When you create a new project, you must choose the project type as "Class Library". Then after you complie the project/solution, you will get a dll file.

Another method is to change the project's properties. In the "Application" Option, change the output type to class library.

Q2. How to use a dll file in .net?

S2: First, you must get the dll file :)

      Then, you should add Reference for this dll, Project->Add Reference.

            btw: It's the same thing in the CPlusPlus and Java.

  Now, when you want to use the function provided by this dll file, you can use the class in the dll to get a instance, then you can get the right to invoke the functions.

e.g. CSample cs = new CSample();

  cs.fun1();

發佈了14 篇原創文章 · 獲贊 2 · 訪問量 15萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章