Directory 类
来源:互联网 发布:mysql 查看使用连接数 编辑:程序博客网 时间:2024/05/23 00:06
https://msdn.microsoft.com/zh-cn/library/system.io.directory(v=vs.80).aspx
using System;using System.IO;class Test{ public static void Main() { // Specify the directories you want to manipulate. string path = @"c:\MyDir"; string target = @"c:\TestDir"; try { // Determine whether the directory exists. if (!Directory.Exists(path)) { // Create the directory it does not exist. Directory.CreateDirectory(path); } if (Directory.Exists(target)) { // Delete the target to ensure it is not there. Directory.Delete(target, true); } // Move the directory. Directory.Move(path, target);//将文件或目录及其内容移到新位置。 // Create a file in the directory. File.CreateText(target + @"\myfile.txt"); // Count the files in the target directory. Console.WriteLine("The number of files in {0} is {1}", target, Directory.GetFiles(target).Length); } catch (Exception e) { Console.WriteLine("The process failed: {0}", e.ToString()); } finally { } string str; str = Console.ReadLine(); }}
0 0
- Directory 类
- 关于Directory类
- Directory
- File类与Directory类
- File类和Directory类
- Directory类和Directioryinfo类
- C# Directory类,文件夹类
- php ----- directory 文件目录类
- C# Directory类的操作
- C# Directory类的操作
- NET中的File类和Directory类
- 获得temporarily directory的类(System类)
- Directory类创建文件夹、删除文件夹。
- Directory类创建文件夹、删除文件夹
- directory path file类使用实例。
- lucene.net文件目录管理Directory类
- 文件夹类Directory的常用方法
- 快速上手之 C# 操作Directory类
- Leetcode 187 Repeated DNA Sequences 重复出现的DNA序列
- Num 19: 最大公约数.最小公倍数.素数的判断
- hadoop分布式集群搭建
- 南邮 OJ 1446 嘉娃的难题
- 归并排序
- Directory 类
- Android SharedPreferences使用以及原理详解
- Rescue(BFS) HDU 1242
- Dubbo与Zookeeper、SpringMVC整合和使用(负载均衡、容错)
- iOS之友盟错误统计解决
- 生成framework ,脚本
- Android adb的一些使用方法
- Android项目Tab类型主界面大总结
- 向指定窗口发送模拟键盘按键消息