Pratik Singhal
Pratik Singhal

Reputation: 6492

Can we retrieve the path where the application is installed?

I have a simple app, which I want to install using click once deployment. I want to retrieve the path where the user installed the app for ex. check the following image:-

enter image description here

I want to retrieve the path which is entered by the user. Is it possible to retrieve that path? If it's possible please suggest a suitable method. The app is made in C#

Upvotes: 0

Views: 44

Answers (1)

therealtbs
therealtbs

Reputation: 162

It is possible to get the path the application is running from.

Just use:

using System.Reflection;
...
Assembly.GetExecutingAssembly().Location

this will give you the path of the Application.

If you want just the folder, you can use

 AppDomain.CurrentDomain.BaseDirectory

Upvotes: 1

Related Questions