string strFilePaht="文件路径";
 Path.GetFileNameWithoutExtension(strFilePath);这个就是获取文件名的

还有的就是用Substring截取
 strFilePaht.Substring(path.LastIndexOf("\\") + 1, path.Length - 1 - path.LastIndexOf("\\"));
   strFilePaht.Substring(path.LastIndexOf("."), path.Length - path.LastIndexOf("."));

或者用openFileDialog1.SafeFileName

 

相关文章:

  • 2021-10-18
  • 2021-07-15
  • 2022-12-23
  • 2021-07-16
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-14
  • 2021-06-11
  • 2021-08-25
  • 2022-12-23
相关资源
相似解决方案