string fullPath = @"\WebSite1\Default.aspx";

string filename = System.IO.Path.GetFileName(fullPath);//文件名  “Default.aspx”
string extension = System.IO.Path.GetExtension(fullPath);//扩展名 “.aspx”
string fileNameWithoutExtension = System.IO.Path.GetFileNameWithoutExtension(fullPath);// 没有扩展名的文件名 “Default”

string str= Path.GetDirectoryName(filePath);//@"\WebSite1

相关文章:

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