string exeFile = (new System.Uri(Assembly.GetEntryAssembly().CodeBase)).AbsolutePath;
string exeDir = Path.GetDirectoryName(exeFile);
string fileName = Path.Combine(exeDir, @"..\..\xml\SalesOrderXMLData.csv.xml");
Hello,
The above code works if the project is located, for example,
C: \ Code \
but not if its in
C: \ Documents and Settings \ Naim \ My Documents ..
If I have a string, I will use escape characters where necessary, but in this case I do not know how to get around this.
Update: result_Name = "D: \ Naim \ My% 20Documents \ Visual% 20Studio% 202008 \ Projects \ XML_Gen \ XML_Gen \ bin \ Debug \ .. \ .. \ xml \ SalesOrderXMLData.csv.xml" Any help is appreciated.
Thanks
source
share