■■■

2016年4月3日日曜日

Environment.SpecialFolderで特殊フォルダのパスを取得する方法

Environment.SpecialFolderで特殊フォルダのパスを取得する方法
VB.NET
'デスクトップのパス
Console.WriteLine(System.Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory))

'お気に入りフォルダのパス

Console.WriteLine(System.Environment.GetFolderPath(Environment.SpecialFolder.Favorites))

'マイドキュメントへのパス

Console.WriteLine(System.Environment.GetFolderPath(Environment.SpecialFolder.Personal))

'スタートメニューフォルダパス

Console.WriteLine(System.Environment.GetFolderPath(Environment.SpecialFolder.StartMenu))

'ウィンドウズシステムフォルダへのパス
Console.WriteLine(System.Environment.GetFolderPath(Environment.SpecialFolder.System))C#
C#
//デスクトップパス
Console.WriteLine(System.Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory));

//お気に入り

Console.WriteLine(System.Environment.GetFolderPath(Environment.SpecialFolder.Favorites));

//マイドキュメント

Console.WriteLine(System.Environment.GetFolderPath(Environment.SpecialFolder.Personal));

//スタートメニュー

Console.WriteLine(System.Environment.GetFolderPath(Environment.SpecialFolder.StartMenu));

//ウィンドウズシステムフォルダ
Console.WriteLine(System.Environment.GetFolderPath(Environment.SpecialFolder.System));

■■■