I am using Visual Studio 2005, (.NET version > 2.0+) to create a windows application.
As per my observation, the relative path of a file can be given in reference of EXE file created in DEBUG folder.
example : if I give path as “images\image.png” the file inside the folder “images” (which inturn located in DEBUG folder) is loaded.
my question is, what if the file exists in a parent folders?
suppose that .. “DEBUG” resides in a “BIN” folder and that has one more folder “IMAGES” which I have to point in my code.(bin/images/image.png)
this need can be avoided by copying “IMAGES” folder inside debug folder itself or by giving the absolute path, but .. I want to know if there is any way to point Parent folders in relative path
doesn’t “..” work? as in,
../../image.png?edit to add some detail: as per MSDN, “A path is also said to be relative if it contains “double-dots”; that is, two periods together in one component of the path. This special specifier is used to denote the directory above the current directory, otherwise known as the “parent directory”.”
two of these ‘double-dots’ would get you the grand-parent folder, as in my example.