![](/img/trans.png)
[英]Is there any way to get Environment.SpecialFolder from file path?
[英]Is there any way to get a file name from a path?
有什么方法可以从路径获取文件名吗?
例如,如何才能得到me.jp
从c:\\MyPic\\OldPic\\me.jpg
?
提前致谢。
您可以看一下Path.GetFileName方法:
string filename = Path.GetFileName(@"c:\MyPic\OldPic\me.jpg");
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.