|
-
Apr 29th, 2011, 09:14 AM
#1
Thread Starter
Addicted Member
[RESOLVED] how to get application path in a dll?
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?
-
Apr 29th, 2011, 09:22 AM
#2
Re: how to get application path in a dll?
This is part of the System.Reflection namespace and should work for you:
vb.net Code:
Assembly.GetExecutingAssembly().Location
-
Apr 29th, 2011, 09:28 AM
#3
Thread Starter
Addicted Member
Re: how to get application path in a dll?
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?
-
Apr 29th, 2011, 09:32 AM
#4
Re: how to get application path in a dll?
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.
-
Apr 29th, 2011, 01:42 PM
#5
Thread Starter
Addicted Member
Re: how to get application path in a 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!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|