i am using below method to get the file names ..
but it returns the entire path ....now i dont want to get the entire path..
I want only file names not the entire path...
how can i get that only file names not the entire path
string filenames = Directory.GetFiles(targetdirectory,"backup-*.zip");
foreach (string filename in filenames)
You could use the GetFileName method to extract only the filename without a path:
string filenameWithoutPath = Path.GetFileName(filename);