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. 记录自己的一次pjax性能优化

    什么是pjax? pjax = ajax + pushState 通过ajax让页面进行局部刷新,然后通过pushstate让url发生改变,再让pushState,让页面产生一个回退的记录,从而让页 ...

  2. 图解SynchronousQueue原理-公平模式

    SynchronousQueue原理详解-公平模式 一.介绍 SynchronousQueue是一个双栈双队列算法,无空间的队列或栈,任何一个对SynchronousQueue写需要等到一个对Sync ...

  3. 朝花夕拾《精通CSS》二、选择器 & 层叠

    一.背景 翻出我4年前看的<精通CSS>一书,可惜当初没有整理读书笔记的习惯,最近又很少写前端,遂很多东西.知识点遗忘了,恰且现在 css 也有些变化和进步,遂一起打包整理,输出成几篇 b ...

  4. DEBUG的基本命令的使用[MASM]

    DEBUG的基本命令的使用 DEBUG是专门为汇编语言设计的一种调试工具,它通过步进,设置断点等方式为汇编语言程序员提供了非常有效的调试手段. DEBUG的命令都是一个字母,后跟一个或多个参数:字母  ...

  5. 腾讯短信+SpringBoot+Redis实现注册逻辑

    使用redis做缓存实现用户的注册功能: 异步请求发送短信,给 发送短信的按钮 绑定异步事件 调用发送短信逻辑发送短信 缓存 key1:验证码 缓存 key2:短信发送时刻的时间 用户提交表单 包含用 ...

  6. 这几个 Chrome 的 Tab 增强插件你都用上了吗?

    1.OneTab:将无数 Tab 合并在一个页面 很多时候我们在一个窗口打开太多的tab,每一个tab太小不容易管理,这时候使用OneTab能够把所有tab收起放在一个页面,点击就可打开该tab,非常 ...

  7. 爬虫模拟有道字典进行翻译,还发现了一条好玩的js

    08.14自我总结 爬虫模拟有道字典进行翻译 一.代码 import requests from lxml.html import etree # headers= { # 'User-Agent': ...

  8. Place an Action in a Different Location 设置按钮的显示位置

    In this lesson, you will learn how to place an Action in the required place. For this purpose, the C ...

  9. VMware虚拟机安装centos7

    镜像下载地址:http://www.linuxdown.net/ 在vmware上开始安装CentOS系统,点击菜单新建虚拟机,进入如下图步骤进行操作.   接着进行自定义硬盘操作   最后虚拟机就创 ...

  10. vue-cli 引用elementUI打包后文件过大

    解决方案:使用externals引用第三方资源,防止element资源被打包到自己项目中,(总共修改3个页面index.html.webpack.base.conf.js.main.js) 1.修改i ...