string fileNameNo = Path.GetFileName(FileUploadImg.PostedFile.FileName); //获取文件名和扩展名

string DirectoryName = Path.GetDirectoryName(FileUploadImg.PostedFile.FileName); //获取文件所在目录

string Extension = Path.GetExtension(FileUploadImg.PostedFile.FileName); //获取扩展名

string fileName = Path.GetFileNameWithoutExtension(FileUploadImg.PostedFile.FileName); //获取文件名(不包括扩展名)

string fullPath = Path.GetFullPath(FileUploadImg.PostedFile.FileName); //获取文件的绝对路径

string PathRoot = Path.GetPathRoot(FileUploadImg.PostedFile.FileName); //获取文件所在地分区

相关文章:

  • 2021-07-27
  • 2021-12-14
  • 2021-10-05
  • 2021-08-06
  • 2021-04-04
  • 2022-12-23
  • 2022-12-23
  • 2021-11-16
猜你喜欢
  • 2022-12-23
  • 2021-06-16
  • 2022-12-23
  • 2022-12-23
  • 2021-07-03
  • 2021-09-22
相关资源
相似解决方案