textbox dial open info 引入 tex lena fin sel

首先的引入 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;

c#獲取文件路徑