new DirectoryInfo(String path) : DirectoryInfo « System.IO « C# / C Sharp by API






new DirectoryInfo(String path)

  
using System;
using System.IO;

public class WildcardTest {

    private static void Main(string[] args) {

        DirectoryInfo dir = new DirectoryInfo("c:\\");
        FileInfo[] files = dir.GetFiles("*");
            
        foreach (FileInfo file in files) {
            Console.Write("Name: " + file.Name + "  ");
            Console.WriteLine("Size: " + file.Length.ToString());
        }
    }
}

   
    
  








Related examples in the same category

1.DirectoryInfo.CreateSubdirectory
2.DirectoryInfo.CreationTime
3.DirectoryInfo.Exists
4.DirectoryInfo.FullName
5.DirectoryInfo.GetDirectories()
6.DirectoryInfo.GetFiles()
7.DirectoryInfo.GetFiles(String filter)
8.DirectoryInfo.LastAccessTime
9.DirectoryInfo.LastWriteTime
10.DirectoryInfo.Name
11.DirectoryInfo.Parent