重命名文件的应用程序! [英] an application to rename files!

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

问题描述

我不知道我的问题有多模糊.
我们可以制作一个应用程序来获取文件夹位置并重命名其中的文件(通过添加前缀/后缀)吗?

任何建议将不胜感激!

我只是发现了几个

I don''t know how vague is my question.
can we make an application which takes in a folder location and rename''s the files within(either by appending prefix/suffix)?

Any suggestion would be appreciated!

I just found few freewares here[^], but i am not allowed to use them at my desk.
Help me discover other ways!

推荐答案

是的,您可以.....

1. Dirctory.GetFiles
2.对于以上结果的长度进行循环
一个. File.Copy为新名称
b. File.删除文件

注意:您必须更正FileIOPermissions才能执行上述过程.
yes you can.....

1. Dirctory.GetFiles
2. For loop through the length of above result
a. File.Copy to the new name
b. File.Delete the file

Note : You have to correct FileIOPermissions to carry the above process.


检查以下示例,其中也包含代码.

http://www.dotnetspark.com/kb/4176-fetching-file- information-from-selected.aspx [ ^ ]

您只需要添加代码即可重命名文件.
使用File.Copy函数,并将文件夹路径与源和目标相同.
它会像重命名一样工作!

如果有用,请标记为答案.

谢谢
戴夫·帕斯(Dave Parth).
Check following example, it contains code as well.

http://www.dotnetspark.com/kb/4176-fetching-file-information-from-selected.aspx[^]

You just need to add code for rename file.
use File.Copy function with Same folder path as source and destination.
it will work like Rename!

Mark as answer, if it is useful.

Thanks
Dave Parth.


当然,您可以编写一个程序来做到这一点-我已经为自己使用编写了这样的工具(可能对您完全没有用).

我不得不问-如果您不被允许使用第三方程序,为什么要允许您使用自己编写的内容?我什至不能在我工作的地方那样做.
Of course you can write a program to do that - I''ve written just such a tool for my own use (and that probably would be completely useless to you).

I have to ask - if you''re not allowed to use 3rd party programs, why would you be allowed to use something you wrote yourself? We can''t even do that where I work.


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

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