110,536
社区成员
发帖
与我相关
我的任务
分享
using (System.Windows.Forms.OpenFileDialog dlg = new OpenFileDialog())
{
if (dlg.ShowDialog() == DialogResult.OK)
{
string strFileName = System.IO.Path.GetFileName(dlg.FileName);
MessageBox.Show(strFileName);
}
}
string filename = "";
OpenFileDialog ofDig = new OpenFileDialog();
if(opd.ShowDialog() == DialogResult.OK)
filename = System.IO.Path.GetFileName(opd.FileName);
MessageBox.Show(filename);