C# PROGRAM TO GET ALL FILE PATHS IN A GIVEN DIRECTORY
using System; using System.IO; namespace GetFileNames { class Program { static void Main(string[] args) { try { string FolderPath ; string[] Files; Console.WriteLine(" Enter the Directory Path to get File Names in it : "); FolderPath=Console.ReadLine(); Files = Directory.GetFiles(FolderPath); Console.WriteLine("\n The FilePaths in given Directory are : \n\n"); foreach (string FileName in Files) { Console.WriteLine(FileName); } Console.ReadLine(); } catch (DirectoryNotFoundException ex) { Console.BackgroundColor = ConsoleColor.Red; Console.WriteLine("\n\n Directory Not Found..Press any key to exit..."); Console.ReadKey(); } } } }
Sample Output1 :
Sample Output2 :
Great Explanation..Very good Example..
ReplyDeleteOnline CSharp
Training
C Sharp Training
Online C# Training from India
C Sharp Training in Chennai
C# Training
Online Dot Net Training
.net online Training
ASP NET Training
Good post! Thanks for sharing this information. I appreciate it. It is very beneficial for visitors.Visit: Sense
ReplyDeleteBest selenium online training institute `
ReplyDeletenice article .thank you for sharing useful info.
ReplyDeleteweb programming tutorial
welookups
This is an best post. It is Really very informative concept.I like it and help me to development very well.Thanks alot for this brief explanation and very nice information.C#.NET Course In Hyderabad
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteI got what i am seraching from last few days in your Blog. I hope you will share more info about it. Please keep sharing.
ReplyDeleteLaptop Service center in Ameerpet
Dell Service center in Ameerpet
HP Service center in Ameerpet
Lenovo Service center in Ameerpet
This comment has been removed by the author.
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteWonderful article. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. This article resolved my all queries.
ReplyDeleteSalesforce Training in Chennai
Salesforce Online Training in Chennai
Salesforce Training in Bangalore
Salesforce Training in Hyderabad
Salesforce training in ameerpet
Salesforce Training in Pune
Salesforce Online Training
Salesforce Training
Here is the site(bcomexamresult.in) where you get all Bcom Exam Results. This site helps to clear your all query.
ReplyDeleteBA 3rd year Result 2019-20
Kumaun University BCOM 3rd Year Result 2020
Bollywood News in Hindi - Check out the latest Bollywood news, new Hindi movie reviews, box office collection updates and latest Hindi movie videos. Download free HD wallpapers of Bollywood celebrities and recent movies and much more on Bollywood Hungama.
ReplyDeleteThe Big Bull Full Movie
Pushpa Full Movie