最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
老外编的程序(六)--目录操作
时间:2022-07-02 11:37:51 编辑:袖梨 来源:一聚教程网
// Takes an array of file names or directory names on the command line.
// Determines what kind of name it is and processes it appropriately
using System;
using System.IO;
using System.Collections;
public class RecursiveFileProcessor {
public static void Main(string[] args) {
foreach(string path in args) {
if(File.Exists(path)) {
// This path is a file
ProcessFile(path);
}
else if(Directory.Exists(path)) {
// This path is a directory
ProcessDirectory(path);
}
else {
Console.WriteLine("{0} is not a valid file or directory.", path);
}
}
}
// Process all files in the directory passed in, and recurse on any directories
// Determines what kind of name it is and processes it appropriately
using System;
using System.IO;
using System.Collections;
public class RecursiveFileProcessor {
public static void Main(string[] args) {
foreach(string path in args) {
if(File.Exists(path)) {
// This path is a file
ProcessFile(path);
}
else if(Directory.Exists(path)) {
// This path is a directory
ProcessDirectory(path);
}
else {
Console.WriteLine("{0} is not a valid file or directory.", path);
}
}
}
// Process all files in the directory passed in, and recurse on any directories
相关文章
- 高清免费观影软件下载-最新电影免费观看软件下载 02-13
- 快手网页版在线看网址-快手网页版观看入口 02-13
- 漫蛙2最新版下载安装包-漫蛙2手机版下载官网入口 02-13
- 抖音小店商家入驻入口-抖音小店商家官网登录入口 02-13
- 口袋48app下载安装2024最新版本-口袋48SNH48官方正版入口 02-13
- 126邮箱网页版直达入口-网易126邮箱官方登录 02-13