1. public partial class SelectFolder : Form   
  2.     {   
  3.         public SelectFolder()   
  4.         {   
  5.             InitializeComponent();   
  6.         }   
  7.   
  8.         private void btnSelectPath_Click(object sender, EventArgs e)   
  9.         {   
  10.             FolderBrowserDialog path = new FolderBrowserDialog();   
  11.             path.ShowDialog();   
  12.             this.txtPath.Text = path.SelectedPath;   
  13.         }   
  14.   
  15.         private void btnSelectFile_Click(object sender, EventArgs e)   
  16.         {   
  17.             OpenFileDialog file = new OpenFileDialog();   
  18.             file.ShowDialog();   
  19.             this.txtFile.Text = file.SafeFileName;   
  20.         }   
  21.   
  22.     }   
  23. 1.jpg 2.jpg 3.jpg
  24. 參考網址:
    http://www.codeproject.com/KB/cs/csFolderBrowseDialogEx.aspx

arrow
arrow
    全站熱搜

    vin0504 發表在 痞客邦 留言(1) 人氣()