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);                  //得到路径

相关文章:

  • 2021-11-14
  • 2022-12-23
  • 2022-01-17
  • 2022-12-23
  • 2021-11-28
  • 2021-11-20
  • 2021-09-04
  • 2022-12-23
猜你喜欢
  • 2021-12-31
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案