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,693
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,709)
- 02. How to: Matrix Numbers | Batch File(1,964)
- 03. How to Password Protect Files on Windows(874)
- 04. How to play Socom 2/3/ and Combined Assault on PC(6,937)
- 05. Modern Warfare 2 Vac Ban Bypass Tutorial(6,283)
- 06. How to embed an image on TheTechGame(3,151)
- 07. [PC] NIOH 2 OTHER USER SAVE RESIGN(13,104)
- 08. Host bot lobbies! Full Tutorial!(11,680)
- 09. Unban yourself [Plutonium BO2](14,328)
- 10. Fall Guys - How to Change Your Name Color on Fall Guys(8,422)
- 11. Best Crosshair Settings for Valorant(6,565)
- 12. Othercide The Surgeon Boss Guide(2,577)
- 13. Othercide Remembrances Unlock Guide(4,529)
- 14. Othercide Beginners Tips and Tricks(2,746)
- 15. How to Fix Grounded Crashes, Loading Time, Low FPS and Other(4,899)
"[C#] How to add .DLL references and use them" :: Login/Create an Account :: 1 comment