I want to get application's path in VirtualStore
.
For example, the file which I need is in this directory (I'm getting this path from registry)
C:\Program Files (x86)\Example App\data.ini
How can I get this path?
C:\Users\User388\AppData\Local\VirtualStore\Program Files (x86)\Example App\data.ini
UPDATE:
This paths in not my application.
I asked how it possible to get path in app data when only know winodows username and path in program files
Assuming that Example App
is the application running the code the first directory is retrieved using
string strFilePath = Path.Combine(Application.ExecutablePath, "Data.ini");
The second doesn't at first glance look like a set location, but for this you can experiment with the Application
and Environment
classes. Try something like
string strFilePath = Path.Combine(Application.UserAppDataPath, "Data.ini");
I hope this helps.
Edit: See this link https://stackoverflow.com/a/3916868/626442 for your answer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With