Skip to content

Instantly share code, notes, and snippets.

@dck-jp
Created September 7, 2012 03:57
Show Gist options
  • Select an option

  • Save dck-jp/3662947 to your computer and use it in GitHub Desktop.

Select an option

Save dck-jp/3662947 to your computer and use it in GitHub Desktop.
C# ConsoleApplication sample
using System;
using System.Text;
namespace ConsoleApplication
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("This program lists all the files in the directory:");
System.IO.DirectoryInfo dir = new System.IO.DirectoryInfo(@"C:\");
foreach (System.IO.FileInfo file in dir.GetFiles("*.*"))
{
Console.WriteLine("{0}, {1}", file.Name, file.Length);
}
Console.ReadLine();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment