FolderBrowserDialog and OpenFileDialog Controls
Posted on 2007-05-25 14:34 带你去月球 阅读(504) 评论(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.
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
}1
private System.Windows.Forms.FolderBrowserDialog folderBrowserDlg;
2
if (this.folderBrowserDlg.ShowDialog() == DialogResult.OK)
3
{
4
//Other operation 
..
5
}
private System.Windows.Forms.FolderBrowserDialog folderBrowserDlg;2
if (this.folderBrowserDlg.ShowDialog() == DialogResult.OK)3
{4
//Other operation 
..5
}
浙公网安备 33010602011771号