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;
}
}
作者: 点A点C
出处: http://www.cnblogs.com/ACshasow/>
关于作者:游戏开发、算法研究,请多多赐教!
本文版权归作者(点A点C)和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出, 原文链接 如有问题, 可邮件(572779130@qq.com)咨询.