提取文件名 [英] Extracting filename

查看:84
本文介绍了提取文件名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我使用openfiledialog让用户选择文件,然后我使用filenames()提取文件
。我现在如何将文件路径

与实际文件名分开?


谢谢


问候

Hi

I am using openfiledialog to get user to select files and then I am
extracting the files using filenames(). How can I now separate the file path
from the actual filename?

Thanks

Regards

推荐答案

*" John" <乔** @ nospam.infovis.co.uk> scripsit:
* "John" <jo**@nospam.infovis.co.uk> scripsit:
我使用openfiledialog让用户选择文件,然后我使用filenames()提取文件。我现在如何将文件路径与实际文件名分开?
I am using openfiledialog to get user to select files and then I am
extracting the files using filenames(). How can I now separate the file path
from the actual filename?




查看''System.IO.Path.GetFileName''。


-

Herfried K. Wagner

MVP·VB Classic,VB.NET

< ; http://www.mvps.org/dotnet>



Have a look at ''System.IO.Path.GetFileName''.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>


嗨约翰,


或者你可能想知道有用性作者:

sFilePath.LastIndexOf(" \")

问候,

Fergus
Hi John,

Or you could wonder about the usefulness of:
sFilePath.LastIndexOf ("\")

Regards,
Fergus


*" Fergus Cooney" <音响****** @ tesco.net> scripsit:
* "Fergus Cooney" <fi******@tesco.net> scripsit:
或者你可能想知道它的用处:
sFilePath.LastIndexOf(" \")
Or you could wonder about the usefulness of:
sFilePath.LastIndexOf ("\")




您确定每个平台都使用\作为路径分隔符?


-

Herfried K. Wagner

MVP·VB Classic,VB.NET

< http://www.mvps.org/dotnet>



Are you sure every platform uses "\" as path separator?

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>


这篇关于提取文件名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆