摘要: 委托 委托类似C++的函数指针,但是函数指针不安全。C#中的委托就是一个新类,每次定义的时候都等于声明一个类。可以这么理解:委托类中储存函数元数据(返回值,参数,函数名),初始化的过程就是给函数具体的内容(就是存的内容是函数指针)。 定义和初始化委托 public delegate string G 阅读全文
posted @ 2021-09-26 17:54 none323 阅读(114) 评论(0) 推荐(0)
摘要: ##从Thread说起 考虑到leetcode上一道题:使用异步编程,依次输出first,second,thrid public class Foo { bool syncFirst = true; bool syncSecond=false; bool syncThird=false; publi 阅读全文
posted @ 2021-09-26 17:53 none323 阅读(48) 评论(0) 推荐(0)
摘要: ##基本数据类型 整形数据: | | | | | | | bigint | 8 byte | |int|4 byte| |smallint|2 byte| |tinyint|1 byte| C#定义的整形数据 | | | | | | | long | 8 byte | | ulong | 8 byt 阅读全文
posted @ 2021-09-26 17:52 none323 阅读(44) 评论(0) 推荐(0)
摘要: 恢复内容开始 文件类型 MDF files are the data files that hold the data and objects such as tables, indexes, stored procedures and views. LDF files are the transa 阅读全文
posted @ 2021-09-26 17:52 none323 阅读(89) 评论(0) 推荐(0)
摘要: 访问修饰符: 类 |Members of | Default member accessibility| | | | |enum | public| |class | private| |interface | public| |struct | private| 方法 属性 字段 扩展方法: 要点 阅读全文
posted @ 2021-09-26 17:52 none323 阅读(23) 评论(0) 推荐(0)
摘要: ##Array Array是个抽象类,不能实例化。Array的具体实现 Person[] people = new Person[] { new Person("nihao",1),new Person("zhishu", 3)}; Array一旦确定就不能改变长度。 ##List 1. List 阅读全文
posted @ 2021-08-17 09:24 none323 阅读(33) 评论(0) 推荐(0)
摘要: 1. IEnumerable,IEnumerator public class MyIEnumerableClass<T> : IEnumerable<T>,IEnumerator<T> //可迭代类自己实现迭代器 { private T[] _data; private int _currentI 阅读全文
posted @ 2021-08-09 11:31 none323 阅读(66) 评论(0) 推荐(0)
摘要: 1. StringBuilder 初始化 StringBuilder sb = new StringBuilder("ABC", 50); sb.Append(new char[] { 'D', 'E', 'F' }); sb.AppendFormat("GHI{0}{1}", 'J', 'k'); 阅读全文
posted @ 2021-08-04 10:20 none323 阅读(60) 评论(0) 推荐(0)
摘要: 1. string str=null 初始化但不分配地址。 2. string str="" 初始化并分配地址,内部储存空字符串。 ##3. string str=string.Empty string.Empty是privacy static readonly类型的数据,内部值同样为"" 但是和" 阅读全文
posted @ 2021-08-03 15:38 none323 阅读(515) 评论(0) 推荐(0)
摘要: 1. 类和结构 类 成员 说明 字段 属性 常量 方法 构造函数 析构函数 索引器 运算符 事件 类型(内部类) 成员说明字段属性常量方法构造函数析构函数索引器运算符事件类型(内部类) 属性: 初始化 public int Age( get; set; )=10 访问修饰符 方法 个数可变的参数 p 阅读全文
posted @ 2021-08-03 13:26 none323 阅读(41) 评论(0) 推荐(0)