如何为同一文件夹中的多个文件重命名文件? [英] How to rename file for more than one file in a same folder ?

查看:556
本文介绍了如何为同一文件夹中的多个文件重命名文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我有文件夹,它包含js,png和pdf文件,我需要重命名所有文件,我知道路径和文件名,请用vb语言回复,可用于每个陈述





问候

Aravind

Hi
I have folder in that it contains js,png and pdf file,i need to rename all files,i know the path and filename,pls reply in vb language,may be use for each statement


Regards
Aravind

推荐答案

请参阅: http://msdn.microsoft.com/en-us/library/system.io.file.move%28v=vs.110%29.aspx [ ^ ]。



是的,这与重命名相同,毫无疑问。



所有文件可能意味着你需要以递归方式获取某个目录中所有文件的列表。请参阅:

http://msdn.microsoft.com/en-us/library/system.io.directory.getfiles%28v=vs.110%29.aspx [ ^ ]。



此外,还有一个需要注意的Microsoft问题。请参阅我以前的回答: Directory.Get.Files搜索模式问题 [ ^ ]。



-SA
Please see: http://msdn.microsoft.com/en-us/library/system.io.file.move%28v=vs.110%29.aspx[^].

Yes, this is the same as "rename", not doubt.

"All files" may mean that you need to get a list of all files in some directory, recursively or not. Please see:
http://msdn.microsoft.com/en-us/library/system.io.directory.getfiles%28v=vs.110%29.aspx[^].

Also, there is a Microsoft problem you need to be aware of. Please see my past answer: Directory.Get.Files search pattern problem[^].

—SA


这篇关于如何为同一文件夹中的多个文件重命名文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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