首先的引入 using System.IO;
OpenFileDialog file = new OpenFileDialog();
file.ShowDialog();
string selectfile = file.SafeFileName;
FileInfo finfo = new FileInfo(selectfile);
this.textBox1.Text = finfo.Directory.ToString() + @"\" + finfo.Name;
时间: 2024-12-04 09:56:57