C # Relative path
source link: https://www.codesd.com/item/c-relative-path.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
C # Relative path
Hello I have a program made in Visual Studio in C#. In this program I have some pictures that need to be called. And some html files that need to be saved. All these files are saved in the map 'mails'. At the moment I have the path:
String pad = @"C:\Users\Charlotte\Desktop\proof of concept\mails\";
I need this path to be relative so the user of the program can just copy the map mails to wherever he/she wants it and execute the exe of my program and just work with it.
Can anyone help me?
You can use function: Directory.GetCurrentDirectory() to get the path of current directory instead of telling program the fullpath.
Related Articles
Using the relative path in a maven project
Related paths in scripts executed by cron jobs
How to use relative paths in ReSharper DotSettings layers
Custom 404 pages are unable to post because of relative path issues
JSP includes the directive, jsp: include action, relative paths relative to absolute paths
Which uses the absolute or relative path?
Get the file size in Java from the relative path to the file
Python relative path problems
How to read the file from the relative path in the Java project? Java.io.File can not find the specified path
Relative path for xsl: import or xsl: include
Creating a relative path to a known folder
Copy the LAMP site to WAMP: relative paths do not work
How to pass the relative path in the assignment
Resolve the absolute path of the relative path and / or filename
How to get a relative path in ASP.NET MVC
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK