■■■

2016年4月3日日曜日

相対パスから絶対パスを取得する方法

相対パスから絶対パスを取得する方法
VB.NET

System.Environment.CurrentDirectory = "C:\Windows\System"

Console.WriteLine(System.IO.Path.GetFullPath("..\file.txt"))
C#

System.Environment.CurrentDirectory = "C:\\Windows\\System";

Console.WriteLine(System.IO.Path.GetFullPath("..\\file.txt"));

■■■