最新下载
热门教程
- 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
相关文章
- 燕云十六声牵丝玉止戈怎么玩 12-16
- 126邮箱免费登录极速版上线-126邮箱与163邮箱功能区别全解析 12-16
- deepseek官网入口在哪-deepseek网页版直达链接 12-16
- 光与影33号远征队复活悖论:复活悖论符文效果与获取方式详解 12-16
- 逃离鸭科夫结局有几个 结局0和结局1达成条件一览 12-16
- 学信网官网登录入口-高等教育学历查询官方通道 12-16