i have filename according to this file name. i need to find file's path. how to find file's path according to filename? i need to find file's path according to file name sample code:
string path= System.IO.Directory.GetDirectories(@"c:\", "kategori",System.IO.SearchOption.AllDirectories).First();
But i need :
string path= System.IO.Directory.GetDirectories(@"anyFolder", "kategori",System.IO.SearchOption.AllDirectories).First();
i need below
Main()
{
string path = PathFinder("Afilename")
}
output: C:\myFiles\AfileName
string PathFinder(string fileName)
{
..................
.................
........
.......
....
..
.
}