OpenFileDialog 用法

OpenFileDialog ofDlg = new OpenFileDialog();
            ofDlg.Filter = "文件夹";
            DialogResult dRet = ofDlg.ShowDialog();
            if (dRet == DialogResult.OK)
            {
                string strFile = ofDlg.FileName;
                textBox2.Text = strFile;
            }
            else
            {
                textBox2.Text = "";
            }
 

你可能感兴趣的:(OpenFileDialog 用法)