CSharp examples for File IO:Path
Work with Relative Paths
using System;/*www . ja va2s . co m*/ using System.IO; static class MainClass { static void Main() { Console.WriteLine("Using: " + Directory.GetCurrentDirectory()); Console.WriteLine("The relative path 'file.txt' " + "will automatically become: '" + Path.GetFullPath("file.txt") + "'"); 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") + "'"); } }