1. Create a new C # console application. The project name is createbll. Open program. CS and rename it to TESTA (you can not rename it) and modify the code,
After writing, you can write other class. CS files.
2. Click "project" in the menu bar and select "createdll properties" from the drop-down list to open the window.
Select "class library" in the output type, close the window, and generate a solution, that is, generate creatbll. DLL file, in the project createbll \ bin \ debug \ createbll. dll Directory.
3. reference the DLL file, create a project referencedll, copy and paste the createbll. dll file generated above to the debug folder of the new project.
4. Right-click the reference in the referencedll project solution. The dialog box is displayed.
Under the browser tab, open the debug file under the referencedll project, find the copied createbll. dll file, and click OK to reference it. 5. Double-click createbll under the reference to open the Object Browser and expand the visible method Testa encapsulated in the createbll. dll file.
6. Compile the corresponding code in the program
Reference createbll first, and then use the code to call the methods in the DLL.