c# - how to get only file names from the directory ,not the entire path -
i using below method file names ..
but returns entire path ....now dont want entire path..
i want file names not entire path...
how can file names not entire path
path= c:\docs\doc\backup-23444444.zip
string[] filenames = directory.getfiles(targetdirectory,"backup-*.zip"); foreach (string filename in filenames) { }
would 1 pls on this.....
many thanks...
you use getfilename method extract filename without path:
string filenamewithoutpath = path.getfilename(filename);
Comments
Post a Comment