最新下载
热门教程
- 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
相关文章
- b站视频播放软件推荐-b站视频播放软件哪款更好用 12-25
- 抖漫动画app最新版本下载安装-抖漫动漫官方正版免费下载 12-25
- 拷贝漫画最新版本下载官网app-拷贝漫画安卓繁体字安装包下载 12-25
- 免费看片视频神器-超清免费看片软件精选 12-25
- 暗黑破坏神2毁灭之王修改器最新版下载-暗黑破坏神2修改器中文版安装包下载 12-25
- 热门成品短视频app下载推荐-精选成品短视频app合集 12-25