OpenFileDialog获取文件名和文件路径问题(转)
转自:http://blog.sina.com.cn/s/blog_7511914e0101cbjn.html
System.IO.Path.GetFullPath(openFileDialog1.FileName); //绝对路径
System.IO.Path.GetExtension(openFileDialog1.FileName); //文件扩展名
System.IO.Path.GetFileNameWithoutExtension(openFileDialog1.FileName); //文件名没有扩展名
System.IO.Path.GetFileName(openFileDialog1.FileName); //得到文件
System.IO.Path.GetDirectoryName(openFileDialog1.FileName); //得到路径