using System;
using System.IO;
namespace 目录
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
ListFiles("G:");
}
public static void ListFiles(string pathname)
{
string[] subFiles = Directory.GetFiles(pathname);
int i = 0;
foreach (string file in subFiles)
{
i++;
Console.WriteLine(file);
}
Console.WriteLine("累计:" + i);
}
}
}