Logo 
Search:

Asp.net Answers

Ask Question   UnAnswered
Home » Forum » Asp.net       RSS Feeds
  Question Asked By: Aysel Kaya   on Dec 02 In Asp.net Category.

  
Question Answered By: Geneva Morris   on Dec 02

Maybe this sample help  you:


// create a reference to the current directory
DirectoryInfo di = new DirectoryInfo(Environment.CurrentDirectory);
// create an array representing the files in the current directory
FileInfo[] fi = di.GetFiles();
Console.WriteLine("The following files exist in the current directory:");
// print out the names of those files
foreach (FileInfo fiTemp in fi)
// get the name od the file  througgh the fileInfo class and trim it with the exstension
Console.WriteLine(fiTemp.Name.TrimEnd(fiTemp.Extension.ToCharArray()));

Share: 

 
 
Didn't find what you were looking for? Find more on file properties Or get search suggestion and latest updates.


Tagged: