So I made myself a class library in .net. I plan on making this .dll do some checks on the application that declares it and uses it. How do I get, say, application.executablepath in the dll?
Printable View
So I made myself a class library in .net. I plan on making this .dll do some checks on the application that declares it and uses it. How do I get, say, application.executablepath in the dll?
This is part of the System.Reflection namespace and should work for you:
vb.net Code:
Assembly.GetExecutingAssembly().Location
Thank you very much!
And just one more thing:
I want to use this dll in my main program. How do I declare it and use its functions?
You will have to add a reference to it in your project. Here is how you can do it, you will navigate to the Browse tab and then find your .dll.
Oh ok thanks! I forgot that if my dll is a .NET class library then I can simply use it like a class and use its functions etc easily. It's not one of those other .dlls where you have to reference it and declare each function and whatnot. Thanks!