//C# //開啟檔案 OpenFileDialog OpenFileDialog1 = new OpenFileDialog(); OpenFileDialog1.CheckFileExists = true; OpenFileDialog1.Filter = "txt files (*.txt)|*.txt"; OpenFileDialog1.Multiselect = false; OpenFileDialog1.ShowDialog(); TextBox.Text = OpenFileDialog1.FileName; //開啟資料夾 FolderBrowserDialog FolderBrowserDialog1= new FolderBrowserDialog(); FolderBrowserDialog1.ShowDialog(); TextBox.Text = FolderBrowserDialog1.SelectedPath;
'VB '開啟檔案 Dim OpenFileDialog1 As OpenFileDialog = New OpenFileDialog OpenFileDialog1.CheckFileExists = True OpenFileDialog1.Filter = "txt files (*.txt)|*.txt" OpenFileDialog1.Multiselect = False OpenFileDialog1.ShowDialog() TextBox.Text = OpenFileDialog1.FileName '開啟資料夾 Dim FolderBrowserDialog1 As FolderBrowserDialog = New FolderBrowserDialog FolderBrowserDialog1.ShowDialog() TextBox.Text = FolderBrowserDialog1.SelectedPath
文章標籤
全站熱搜
留言列表