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. bootstrap-select使用过程中的一些问题

    这里总结一下上次使用bootstrap-select的过程中遇到的一些问题.至于bootstrap-select的具体使用方法这里就不介绍了,网上有很多例子. 地址: 官方插件地址:https://d ...

  2. python语言程序设计基础(第二版)第五章答案随笔

    1.实现isOdd()函数,参数为整数,如果整数是奇数,返回True,否则返回False def isOdd(num):    if num % 2 == 0:        return True  ...

  3. java 单链表 练习

    练习一下java单链表的简单习题 package com.test1; import java.util.Stack; public class SingleListDemo { /** * 返回单链 ...

  4. Java中Atomic类的使用分析

    1:为什么会出现Atomic类 在多线程或者并发环境中,我们常常会遇到这种情况 int i=0; i++ 稍有经验的同学都知道这种写法是线程不安全的.为了达到线程安全的目的,我们通常会用synchro ...

  5. maven仓库之第一篇

    maven jar仓库 :存放maven项目使用的jar包. 中央仓库,存放99%免费开源项目jar包,apache公司负责维护的,以T为单位的存储. 例如 : struts2-core-2.3.24 ...

  6. CAD转DXF怎么转换?教你三种转换方法

    CAD图纸在我们日常生活中都是可见到的,因为CAD图纸文件的格式是多样的,在工作中就需要经常将CAD的格式进行转换.那CAD转DXF怎么转换呢?这个问题很多的小伙伴们都遇到过,下面小编就来教大家三种转 ...

  7. Ling to sql 多表查询,多个条件进行关联

    使用多表查询进行关联时,提示 join子句中其中一个表达式的类型不正确,注意字段类型和名称要一致,否则join时提示语法错误,错误截图如下 var incomeDetails = from a in ...

  8. http请求post,文件导出兼容IE10+

    1.post的方法里要加responseType: 'blob'参数,不然下载的excel会乱码 2.使用{type: "application/vnd.ms-excel"}的写法 ...

  9. Android 组件化最佳实践 ARetrofit 原理

    本文首发于 vivo互联网技术 微信公众号 https://mp.weixin.qq.com/s/TXFt7ymgQXLJyBOJL8F6xg作者:朱壹飞 ARetrofit 是一款针对Android ...

  10. 网络编程~~~C/S B/S 架构

    C: client 客户端 B: browse 浏览器 S: server 服务器端 C/S架构: 基于客户端与服务端之间的通信 优点: 个性化设置, 响应速度快 缺点: 开发成本和维护成本高, 占用 ...