// folderdlg2.cs using System; using System.Windows.Forms; public class FolderBrowserDialog2 { static void Main() { FolderBrowserDialog fbd = new FolderBrowserDialog(); fbd.Description = "マイ・コンピュータ以下から選択" + "\n-[新しいフォルダ]ボタン非表示" + "\n- 開始フォルダはc:\\Inetpub\\wwwroot"; fbd.RootFolder = Environment.SpecialFolder.MyComputer; fbd.SelectedPath = @"c:\inetpub\wwwroot"; fbd.ShowNewFolderButton = false; DialogResult dr = fbd.ShowDialog(); if (dr == DialogResult.OK) { Console.WriteLine(fbd.SelectedPath); } } } // コンパイル方法:csc folderdlg2.cs