How do I get the full path for a given file?
e.g. I provide:
string filename = @\"test.txt\";
Result should be:
Full Fi
try:
string fileName = @"test.txt";
string currentDirectory = Directory.GetCurrentDirectory();
string[] fullFilePath = Directory.GetFiles(currentDirectory, filename, SearchOption.AllDirectories);
it will return full path of all such files in the current directory and its sub directories to string array fullFilePath. If only one file exist it will be in "fullFileName[0]".