static void RenameFiles()
{
string sourceDir = @"D:\ll";
string[] allFiles = Directory.GetFiles(sourceDir, "*.mp3", SearchOption.AllDirectories); if(allFiles!=null && allFiles.Any())
{
for(int i = ; i < allFiles.Count(); i++)
{
string newName =Path.Combine(sourceDir, i + ".mp3");
File.Move(allFiles[i], newName);
}
}
}

C# rename files的更多相关文章

  1. Rename in Batch [Python]

    #!/usr/bin/python2.7 # Program: # Rename files in current folder in batch. # Date: # 2016-04-17 # Us ...

  2. Files and Directories

    Files and Directories Introduction     In the previous chapter we coveredthe basic functions that pe ...

  3. 【原】The Linux Command Line - Manipulation Files And Directories

    cp - Copy Files and directories mv - move/rename files and directories mkdir - create directories rm ...

  4. Notes for Apue —— chapter 4 Files and Directories(文件和目录)

    4.1 Introduction 4.2 stat, fstat, fstatat, and lstat Functions The lstat function is similar to stat ...

  5. Linux下的rename命令

    Dos/Windows下,对文件改名用rename.而书上说,Linux下对文件或目录改名该用mv.我一直也是这样做的,却忽略了Linux下也有个叫rename的命令.都是rename,但功能上就有点 ...

  6. shell rename directory

    mv can do two jobs. It can move files or directories It can rename files or directories To just rena ...

  7. Linux命令之rename

    一.引言 今天才知道Linux下的rename有两个版本,util-linux工具集的rename和Perl版本的rename,而两者的用法是明显不一样的,Perl版rename相对比较强大 二.对比 ...

  8. Manipulating Files

    http://linuxcommand.org/lc3_lts0050.php This lesson will introduce you to the following commands: cp ...

  9. [Bash] Move and Copy Files and Folders with Bash

    In this lesson we’ll learn how to move and rename files (mv) and copy (cp) them. Move index.html to ...

随机推荐

  1. 高阶函数&&高阶组件(二)

    高阶组件总共分为两大类 代理方式 操纵prop 访问ref(不推荐) 抽取状态 包装组件 继承方式 操纵生命周期 操纵prop 代理方式之 操纵prop 删除prop import React fro ...

  2. Java面试题和解答(五)

    1.在Java中Executor和Executors的区别? Executor是线程池的顶层接口,它的实现类如下图所示: Executors是一个类,提供了多个静态方法,用于生成不同类型的线程池,如下 ...

  3. 你真的会用搜索吗?—— google 搜索技巧

    鄙人用了那么多年 google ,却只会简单的空格. 虽然空格已经很强大了.google 对此做了非常多的优化,原则是让你只用最基础的输入搭配空格就能达到跟下面介绍的方法几乎一样的效果,但是还有知道一 ...

  4. lombok深入实践

    官网视频 官网地址:https://projectlombok.org 官网的首页视频演示在eclipse中如何使用Lombok; Project Lombok is a java library t ...

  5. 易优CMS:arclist 文档列表

    arclist 文档列表(配合arcpagelist标签可实现ajax瀑布流分页)  [基础用法] 名称:arclist 功能:获取系统主从表模型(如:文章.软件.图集.产品等)的一列文档,也称自由列 ...

  6. form表单中的button自动刷新页面问题

    form表单中如果存在button的话,有可能会出现一个问题:点击button,触发了页面的自动刷新事件. 原因是因为<button>标签默认的类型是submit,即默认的button点击 ...

  7. date:显示与设置系统时间

    功能: date命令用于显示当前的系统时间或设置系统时间 语法格式: date [option] [+format] date [选项] [+日期格式] 参数选项: option 参数选项: -d  ...

  8. 拥抱webpack4,有效缩减构建时间57%+

    背景 最近有感觉到,随着系统模块数量的增加,wepack编译打包的速度越来越慢,于是我想给项目做一下优化升级,也借此机会系统地学习一下webpack4. 升级过程 当前版本 "depende ...

  9. Maven学习 --- <distributionManagement>

    在使用maven过程中,我们在开发阶段经常性的会有很多公共库处于不稳定状态,随时需要修改并发布,可能一天就要发布一次,遇到bug时,甚至一天要发布N次.我们知道,maven的依赖管理是基于版本管理的, ...

  10. linux-VMtools安装

    一.解决的问题 1.剪切板无法共享 2.共享文件夹的设置 3.窗口无法自适应 二. 安装 1.进入centos 2.点击VMware菜单--->install VMware tools 3.打开 ...