随笔分类 -  C#

摘要:File类使用 1.0 代码示例 using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; 阅读全文
posted @ 2022-04-02 16:02 Chris丶Woo 阅读(41) 评论(0) 推荐(0)
摘要:Path类的使用 1.0、原始获取文件名的方法 int index = fileName.LastIndexOf("\"); string name = fileName.Substring(index + 1); Console.WriteLine(name); 1.4 根据Path类获取文件路径 阅读全文
posted @ 2022-04-02 15:46 Chris丶Woo 阅读(79) 评论(0) 推荐(0)
摘要:结构体 结构体关键字struct 类似于Delphi 的 record类型 结构体内部的属性是属于字段不属于变量 结构体中可以引用枚举类型 using System; using System.Collections.Generic; using System.Linq; using System. 阅读全文
posted @ 2022-04-01 20:12 Chris丶Woo 阅读(46) 评论(0) 推荐(0)
摘要:枚举的使用 1.0 一般怎么使用枚举是为了规范类型 如性别、季节。枚举的使用类型如下代码 public enum Gender { 男 = 1, 女 = 2 } public enum Gender2 { 男 , 女 } public enum Season { 春 = 1, 夏 = 2, 秋 = 阅读全文
posted @ 2022-04-01 19:58 Chris丶Woo 阅读(178) 评论(0) 推荐(0)