Set Current Directory : Directory : File Stream C# Source Code


Custom Search

C# Source Code » File Stream » Directory »

 

Set Current Directory








    


using System;
using System.IO;

class MainClass {
    static void Main() {
        Console.WriteLine("Changing current directory to c:\\");
        Directory.SetCurrentDirectory(@"c:\");

        Console.WriteLine("Now the relative path 'file.txt' " + "will automatically become '" + Path.GetFullPath("file.txt") + "'");
    }
}
           
       
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo File Stream
» Directory