Output File System Information - CSharp File IO

CSharp examples for File IO:File

Description

Output File System Information

Demo Code

using static System.Console;
using static System.IO.Directory;
using static System.IO.Path;
using static System.Environment;
class Program//w w w.j  a v  a 2  s .com
{
   static void Main(string[] args)
   {
      WriteLine($"Path.PathSeparator:              {PathSeparator}");
      WriteLine($"Path.DirectorySeparatorChar:     {DirectorySeparatorChar}");
      WriteLine($"Directory.GetCurrentDirectory(): {GetCurrentDirectory()}");
      WriteLine($"Environment.CurrentDirectory:    {CurrentDirectory}");
      WriteLine($"Environment.SystemDirectory:     {SystemDirectory}");
      WriteLine($"Path.GetTempPath():              {GetTempPath()}");
      WriteLine($"GetFolderPath(SpecialFolder):");
      WriteLine($"  System:                        {GetFolderPath(SpecialFolder.System)}");
      WriteLine($"  ApplicationData:               {GetFolderPath(SpecialFolder.ApplicationData)}");
      WriteLine($"  MyDocuments:                   {GetFolderPath(SpecialFolder.MyDocuments)}");
      WriteLine($"  Personal:                      {GetFolderPath(SpecialFolder.Personal)}");
   }
}

Result


Related Tutorials