A03_IO文件管理
来源:互联网 发布:云图制作软件 编辑:程序博客网 时间:2024/06/16 05:51
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;using System.IO;namespace A03_IOFileManagement{ class Demo5 { private string _Path1 = @"E:\test1.txt"; private string _Path2 = @"D:\test1.txt"; //创建文件 public void Test1() { File.Create(_Path1); } //删除文件 public void Test2() { File.Delete(_Path1); } //移动(剪切) public void Test3() { File.Move(_Path1, _Path2); } //文件是否存在 public void Test4() { bool bIsExists = File.Exists(_Path2); Console.WriteLine(bIsExists); } //文件的拷贝 //默认不支持覆盖操作 public void Test5() { File.Copy(_Path2, _Path1); //File.Copy(_Path2, _Path1,true); //第三个参数表示是否支持覆盖操作。 } static void Main3(string[] args) { Demo5 obj = new Demo5(); //obj.Test1(); //obj.Test2(); //obj.Test3(); //obj.Test4(); obj.Test5(); } }}
阅读全文
0 0
- A03_IO文件管理
- 文件管理
- 文件管理....
- 文件管理
- 文件管理
- 文件管理
- 文件管理
- 文件管理
- 文件管理
- 文件管理
- 文件管理
- 文件管理
- 文件管理
- 文件管理
- 文件管理
- 文件管理
- 文件管理
- 文件管理
- 认知与身体: 理论心理学的视角
- thinkPHP地址URL跳转问题
- dialogfragment链式调用封装
- 安装redis
- ResNet 6大变体对比
- A03_IO文件管理
- ionic3开发系列——打包APK运行,启动页后白屏几秒,解决方案
- E
- 算法爱好者——子集 ? 待解决
- codeigniter3.16版本migration(数据工厂迁移类)的使用
- 一道挤奶的奶牛题的题解
- Kotlin使用Retrofit进行get请求的方法(懒加载机制)
- shrio 权限管理filterChainDefinitions过滤器配置
- [Leetcode] 500. Keyboard Row 解题报告