zoukankan      html  css  js  c++  java
  • 修改文件夹中的文件名

     1 using System;
     2 using System.Collections.Generic;
     3 using System.Linq;
     4 using System.Text;
     5 using System.Text.RegularExpressions;
     6 using System.IO;
     7 
     8 namespace ConsoleApplication1
     9 {
    10     class Program
    11     {
    12         static void Main(string[] args)
    13         {
    14 
    15             DirectoryInfo dir = new DirectoryInfo(args[0]);
    16             bool test = dir.Exists;
    17             if (dir.Exists)
    18             {
    19                 foreach (FileInfo file in dir.GetFiles())
    20                 {
    21                     File.Move(args[0] + "\" + file.Name, args[0] + "\" + "accccc.txt");
    22                     break;
    23                 }
    24             }
    25             else
    26             {
    27                 Console.WriteLine("The directory {0} does not exist", args[0]);
    28             }
    29 
    30         }            
    31     }
    32 }
  • 相关阅读:
    两种方法生成随机字符串
    cmd命令总结
    NOI前乱写
    多校模拟9
    字符串 口胡
    HEOI2020游记
    省选模拟104
    省选模拟103
    省选模拟102
    省选模拟101
  • 原文地址:https://www.cnblogs.com/kakamilan/p/3242127.html
Copyright © 2011-2022 走看看