Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

ASP.NET rename all files in a folder



    private void RenameFiles(string source)
    {
        foreach (string fName in Directory.GetFiles(source))
        {
            string Dfile = string.Empty;
            dFile = Path.GetFileName(fName);
            string Dfilepath = string.Empty;
            dFilePath = source + dFile;
            FileInfo fi = new FileInfo(dFilePath);
           
            fi.MoveTo(source + dFile.Replace("_0","_1"));
        }

    }


This post first appeared on Networks, please read the originial post: here

Share the post

ASP.NET rename all files in a folder

×

Subscribe to Networks

Get updates delivered right to your inbox!

Thank you for your subscription

×