标签:img ict for console class png files write alt
用于操作文件夹
Directory.CreateDirectory(@"D:\a");
Directory.Delete(@"D:\a",true);
Directory.Move(@"D:\a", @"C:\Users\22053\Desktop\new");
string[] path = Directory.GetFiles(@"C:\Users\22053\Desktop\Picture", "*.png");
for (int i = 0; i < path.Length; i++) {
Console.WriteLine(path[i]);
}
Console.ReadKey();
运行:
string[] path = Directory.GetDirectories(@"C:\Users\22053\Desktop\new");
for (int i = 0; i < path.Length; i++) {
Console.WriteLine(path[i]);
}
Console.ReadKey();
运行:
if (Directory.Exists(@"D:\a\b")) {
for (int i = 0; i < 100; i++) {
Directory.CreateDirectory(@"D:\a\b\" + i);
}
}
Console.WriteLine("OK");
Console.ReadKey();
标签:img ict for console class png files write alt
原文地址:https://www.cnblogs.com/lz32158/p/12972907.html