【发布时间】:2010-05-20 06:01:37
【问题描述】:
嗨,
我正在尝试从我的代码中的文件路径检索图像文件的文件名。
我的文件路径:c:\mydocuments\pictures\image.jpg
我可以在 c# 中使用哪种方法来获取上述路径的文件名。
Like String file = image.jpg
我已经使用system.drawing来获取他的路径,但它返回null。
我的代码:
string file = System.drawing.image.fromfile(filepath,true);
这是获取图像文件名的正确方法还是c#中有任何其他内置方法。
请帮我解决这个问题?
【问题讨论】: