Learn about path in C#

Learn about path in C#

If you need to get path of specific folders or files in this article I've created short list of codes for you to save time:

AppData folder path:


App installation folder (where your app files are located)


// OR


File path (getting specific file address)

This will get specific file from AppData folder

    Environment.SpecialFolder.ApplicationData), "MyFile.dll");

Now if you want to get file path from installation (root) folder of your application, all you have to do is to change Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) part with codes I've shared above. (Don't forget to change file name as well).

To learn more about path class you can refer to official documentation on Microsoft website.

- Last updated 3 weeks ago

Be the first to leave a comment.

You must login to leave a comment