保存一下获取文件的路径小方法
//浏览
public string GetFilePath()
{
System.Windows.Forms.OpenFileDialog openFileDialog = new System.Windows.Forms.OpenFileDialog();
openFileDialog.Title = "浏览";
openFileDialog.Filter = "(*.jpg,*.png,*.jpeg,*.bmp,*.gif)|*.jgp;*.png;*.jpeg;*.bmp;*.gif|All files(*.*)|*.*";
openFileDialog.FileName = string.Empty;
System.Windows.Forms.DialogResult result = openFileDialog.ShowDialog();
if (result == System.Windows.Forms.DialogResult.Cancel) return "";
return System.IO.Path.GetFullPath(openFileDialog.FileName);
}