FolderBrowserDialog and OpenFileDialog Controls
Posted on 2007-05-25 14:34 带你去月球 阅读(503) 评论(0) 收藏 举报
1.
1
private System.Windows.Forms.OpenFileDialog opnXMLFile;
2
3
opnXMLFile.Filter = "XML files (*.xml)|*.xml|All Files (*.*)|*.*";
4
if (opnXMLFile.ShowDialog() == DialogResult.OK)
5
{
6
string xmlFile = opnXMLFile.FileName;
7
// Other operation ........
8
}
2.
2

3

4

5

6

7

8

1
private System.Windows.Forms.FolderBrowserDialog folderBrowserDlg;
2
if (this.folderBrowserDlg.ShowDialog() == DialogResult.OK)
3
{
4
//Other operation 
..
5
}

2

3

4



5
