about 8 years ago
HI Friends,
Today i will specify you how we can access directories from a specific path in c# . Below code justify the functionality :-
try { DirectoryInfo directoryinfo = new DirectoryInfo(@"D:\Test"); //Get all directories from specified path DirectoryInfo[] data = directoryinfo.GetDirectories(); //Pick up all directories using for each loop foreach (DirectoryInfo item in data) { FileInfo[] files = item.GetFiles(); //Get all files foreach (var file in files) { Console.WriteLine(file.Name); } Console.WriteLine("Directory Name :" + item.Name + "\tTotal File :" + files.Count()); } Console.WriteLine(data.Count()); Console.ReadLine(); } catch (Exception ex) { //Log exception }
Thanks Happy Coding!!
Starting with Chrome version 45, NPAPI is no longer supported for Google Chrome. For more information, see Chrome and NPAPI (blog.chromium.org).
Firefox and Microsoft Internet Explorer are recommended browsers for websites using java applets.
Chrome Version Support
Are you sure, you want to delete this comment?
Sign up using
0 Comment(s)