c4-03.cs

来自「一本很好的教材.C#开发者必备.内容全面,很难得哦.」· CS 代码 · 共 18 行

CS
18
字号
//使用 I/O 类来创建目录列表示例
using System;
using System.IO;
class DirectoryLister
{
   public static void Main(String[] args)
   {
      DirectoryInfo dir = new DirectoryInfo(".");
      foreach (FileInfo f in dir.GetFiles("*.cs")) 
      {
         String name = f.FullName;
         long size = f.Length;
         DateTime creationTime = f.CreationTime;
         Console.WriteLine("{0,-12:N0} {1,-20:g} {2}", size, 
            creationTime, name);
      }
   }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?