最佳答案
从路径获取文件名的最简单方法是什么?
string filename = "C:\\MyDirectory\\MyFile.bat"
在这个例子中,我应该得到没有扩展名的“ MyFile”。