Tutorials Navigation
[C#] How to add .DLL references and use them
Tutorial Name: [C#] How to add .DLL references and use them
Category: PC Tutorials
Submitted By: Skittle
Date Added:
Comments: 1
Views: 1,687
Related Forum: PC Building Forum
Share:
This tutorial will be linked to my previous one in which I showed you how to make your own .DLL Class Library.
Create your project in Visual Studio and find your Solution Explorer:
Right click on the object at the top of the file tree, click Add and click Reference:
Click Browse to find the .DLL that you want to add as a reference, make sure that that CheckBox next to it is checked and press Ok:
You will know that you have done this correctly as you will see your reference in the Solution Explorer under References:
At the top of your code, add:
using [Name of .dll];
The code to add will not always be the same as the name of the .dll, but it will be related. If you don't know, after you type using you can scroll through the list to find it.
Now, all you need to do is reference the Class Name with the Methods you want to call, as you have referenced the namespace at the top with using you only need to use ClassName.MethodName(); All you need to do is find the Class Name, which you can find by typing the namespace name, in this case my one is Skittle_Function_Library and you will be given all of the classes that are contained inside it, my only class is MathFunctions and my Methods inside MathFunctions are isOdd and isEven:
So to call the procedures, all you need to do is put ClassName.MethodName(); which in my case would be MathFunctions.isOdd:
if(MathFunctions.isOdd(21) == true)
{
MessageBox.Show("21 is Odd!");
}
If you need any help with anything, feel free to PM me
Ratings
Comments
Related Tutorials
- 01. Emulating Xbox 360 on PC for Running COD4 With Mods(3,492)
- 02. How to: Matrix Numbers | Batch File(1,903)
- 03. How to Password Protect Files on Windows(857)
- 04. How to play Socom 2/3/ and Combined Assault on PC(6,717)
- 05. Modern Warfare 2 Vac Ban Bypass Tutorial(6,133)
- 06. How to embed an image on TheTechGame(3,098)
- 07. [PC] NIOH 2 OTHER USER SAVE RESIGN(12,981)
- 08. Host bot lobbies! Full Tutorial!(11,243)
- 09. Unban yourself [Plutonium BO2](14,240)
- 10. Fall Guys - How to Change Your Name Color on Fall Guys(8,385)
- 11. Best Crosshair Settings for Valorant(6,525)
- 12. Othercide The Surgeon Boss Guide(2,539)
- 13. Othercide Remembrances Unlock Guide(4,460)
- 14. Othercide Beginners Tips and Tricks(2,708)
- 15. How to Fix Grounded Crashes, Loading Time, Low FPS and Other(4,845)
"[C#] How to add .DLL references and use them" :: Login/Create an Account :: 1 comment