If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Bulk rename files program in c#?

Is it possible to make a program that takes files and can take something out of their original name? I.E. the file 1.txt, that file 2.txt, this file 3.txt, changed to take "this" out and only say the 1.txt, that 2.txt, and this 3.txt ?
If it's possible, how would I go about doing that?

Re: Bulk rename files program in c#?

I'm getting the error

Code:

Error 1 'System.Array' does not contain a definition for 'Replace' and no extension method 'Replace' accepting a first argument of type 'System.Array' could be found (are you missing a using directive or an assembly reference?)

for the line

Code:

String newFileName = oldFileName.Replace("file", String.Empty);

Am I suppose to turn oldFileName into a string instead of keeping it as an array? Or turn newFileName into an array?

* The Perfect Platform for Game Developers: Android
Developing rich, high performance Android games from the ground up is a daunting task. Intel has provided Android developers with a number of tools that can be leveraged by Android game developers.

* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.