Sometimes you may need to get the files from a specified directory using C# / C Sharp. See the sample code on how it works.

using System;
using System.IO;

class MainClass
  public static void Main()
    string[] yourFiles = Directory.GetFiles("c:");

    foreach (string fNames in yourFiles)



This code will get you files from the root directory.



One Comment

  1. Doggy April 26, 2011 at 4:18 pm


    Directamente en la manzana


Leave a Reply

Your email address will not be published. Required fields are marked *




Theme by HermesThemes

Copyright © 2018 CoderzHeaven. All Rights Reserved

Please wait...

Subscribe to our newsletter

Want to be notified when our article is published? Enter your email address and name below to be the first to know.