try:
string fileName = @"test.txt"; string currentDirectory = Directory.GetCurrentDirectory(); string[] fullFilePath = Directory.GetFiles(currentDirectory, filename, SearchOption.AllDirectories);
it will return the full path for all such files in the current directory and its auxiliary directories to the fullFilePath string array. If only one file exists, it will be in "fullFileName [0]".
source share