摘要: using System.IO; namespace streamWrite方法 { class Program { static void Main(string[] args) { string path = "D:\\123\\123.txt"; string conTent = "中华人民共 阅读全文
posted @ 2022-06-02 19:20 sbwynnss 阅读(547) 评论(0) 推荐(0) 编辑
摘要: using System.IO;//必须包含此命令空间 static void Main(string[] args) { byte[] byteFile = new byte[30]; char[] charFile = new char[30]; string path = @"D:\TEST. 阅读全文
posted @ 2022-06-02 13:43 sbwynnss 阅读(146) 评论(0) 推荐(0) 编辑
摘要: using System.IO; namespace 获取文件夹和文件路径 { class Program { static void Main(string[] args) { string[] filePath = Directory.GetFiles(@"D:\123");//文件路径 str 阅读全文
posted @ 2022-06-01 20:35 sbwynnss 阅读(291) 评论(0) 推荐(0) 编辑
摘要: using System.IO;//先添加命名空间 static void Main(string[] args) { string fle = @"D:\123\123.txt"; FileInfo fileInfo = new FileInfo(fle); Console.WriteLine(" 阅读全文
posted @ 2022-05-31 21:01 sbwynnss 阅读(207) 评论(0) 推荐(0) 编辑
摘要: namespace 文件的创建 { class Program { static void Main(string[] args) { string path = @"C:\"; if (!File.Exists(path + "ww.txt")) { FileStream fs = File.Cr 阅读全文
posted @ 2022-05-30 16:04 sbwynnss 阅读(68) 评论(0) 推荐(0) 编辑
摘要: namespace 判断某文件是否存在 { class Program { static void Main(string[] args) { string path = "C:\\tt.jpg"; bool ph= File.Exists(path);//判断是否有这个文件 if (ph) { C 阅读全文
posted @ 2022-05-30 15:27 sbwynnss 阅读(89) 评论(0) 推荐(0) 编辑
摘要: using System; namespace 泛型继承之普通类继承泛型类 { abstract class genClass<T> { protected T field; public virtual T property { set { field=value; } } public genC 阅读全文
posted @ 2022-05-29 17:26 sbwynnss 阅读(200) 评论(0) 推荐(0) 编辑
摘要: namespace 索引器在接口中使用 { public interface Ifindex//定义一个接口 { int this[int index]//声明索引 { get; set; } } public class TestIndex:Ifindex//继承接口 { int[] myint 阅读全文
posted @ 2022-05-28 22:11 sbwynnss 阅读(33) 评论(0) 推荐(0) 编辑
摘要: namespace 属性Set与Get { class Program { static void Main(string[] args) { EmployeeInformation emp = new EmployeeInformation();//创建对象 //以下是对字段的一般性赋值: emp 阅读全文
posted @ 2022-05-28 15:11 sbwynnss 阅读(35) 评论(0) 推荐(0) 编辑
摘要: using System.Collections;//必须添加的命名空间 namespace 迭代的一般应用 { class Program { static void Main(string[] args) { IterationMonths im = new IterationMonths(); 阅读全文
posted @ 2022-05-28 11:22 sbwynnss 阅读(14) 评论(0) 推荐(0) 编辑