本文版权归点A点C和博客园共有,欢迎转载,但必须保留此段声明,并给出原文连接,谢谢合作!!!

C#中,打开openFileDialog后,如何将选中的文件路径显示在一个文本框(textBox)中

OpenFileDialog openFileDialog1 = new OpenFileDialog();
openFileDialog1.Filter = "文档(*.doc;*.docx)|*.doc;*.docx";
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
if (openFileDialog1.FileName != "")
{
this.textBox3.Text = openFileDialog1.FileName;
}
}

posted on 2013-08-12 17:51  点A点C  阅读(5814)  评论(0编辑  收藏  举报

导航