Installation directory

M

Mario

Dear all,
I have created a class library DLL containing some functionalities. Then I
have created a"Setup and deployment" project in order to create the
installation kit. After this, I have installed it on my computer in a
directory.

Now the question: in my DLL's code there is a section where I try to write a
text file and I'd like to write it in the same directory where the DLL has
been installed. Is there a way to get directory where the DLL is "running"?

Thank you very much
 
C

Clive Lumb

Mario said:
Dear all,
I have created a class library DLL containing some functionalities. Then I
have created a"Setup and deployment" project in order to create the
installation kit. After this, I have installed it on my computer in a
directory.

Now the question: in my DLL's code there is a section where I try to write
a
text file and I'd like to write it in the same directory where the DLL has
been installed. Is there a way to get directory where the DLL is
"running"?

Thank you very much

If the dll is in the same folder as the application then you can use
App.path (for VB6) or Application.StartupPath() (for .Net).
However on Vista most users will not have the right to create or modify
files in the application folder.
You should look at using the the user's ApplicationData "Special" folder
which is the correct place for such files that the application is going to
modify.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top