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

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -