![](/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.