如何在C#中更改多个文件名?

时间:2015-02-23 17:07:17

标签: c# string replace

我的文件名包含需要递减1的数字。我需要满足以下伪代码的代码:

class ReplaceSubstrings
    {
        string searchFor;
        string replaceWith;
        Bool filenamecontainnumbers; 'file name contains numbers to be       decremented by 1
        int filenamenumbers; ' file name size varies from 10 to 500 - I only want to          ' target integers 200 - 500

    while(filenamecontainsnumbers = 1) ' maybe I should use Bool condition

    ReplaceSubstrings app = new ReplaceSubstrings();
    If(filenamenumbers > 200){
        app.searchFor = filenamenumbers; // A very simple regular expression.
        app.replaceWith = decnamenumber();
        Console.WriteLine(s);

    return 0; 

}


void decnamenumber(){

filenamenumbers = filenamenumbers - 1;

 };

或类似的东西!请帮助!!!

1 个答案:

答案 0 :(得分:0)

在c#中“重命名”你可以“移动”文件:看看这个http://www.dotnetperls.com/file-move