Hi, I wonder if you guys could help.
I am writing an application that will run on several servers and, therefore, multiple IPs and instead of using the exact structure of IP and directories, I would just like to βbacktrackβ from the folder where the application is really running, For example ....
Folder structure
\ controls \ ---- This contains an aspx file that will check if the xml file exists in the blogengine folder.
\ blogengine \ This should contain xml files
The code I use is ......
string[] filePaths = Directory.GetFiles(@"\\94.175.237.35\inetpub$\wwwroot\mytest\BlogEngine\", "*.xml");
That will find files on a specific server, but I need to find files in relation to the server on which the application is running, so I do not need to change the path to the file. So i need something like
string[] filePaths = Directory.GetFiles(@"..\BlogEngine\", "*.xml");
But I can not find the correct syntax to do this?
Somebody knows?
Thanks in advance Craig
source share