上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 21 下一页
摘要: init关键字: 1.init在属性或索引器中定义访问器方法 2.仅在对象构造期间为属性或索引器元素赋值 3.init强制实施不可变性(对象一旦初始化,将无法更改) 4.如下同时定义get和init访问器 class Person_InitExample { private int _yearOfB 阅读全文
posted @ 2024-09-19 17:01 echo-efun 阅读(259) 评论(0) 推荐(0)
摘要: 1.fixed语句 *固定用于指针操作的变量; *可防止垃圾回收器重新定位可移动变量,并声明指向该变量的指针; *固定变量的地址,在语句的持续时间内不会更改 *fixed语句中,只能使用声明的指针,声明的指针是只读的,无法修改 *fixed语句只能在不安全的上下文中使用 static void Ma 阅读全文
posted @ 2024-09-19 11:16 echo-efun 阅读(1116) 评论(0) 推荐(0)
摘要: xml位于命名空间中时查找 static void Main(string[] args) { XElement root = XElement.Parse(@"<aw:Root xmlns:aw='http://www.efun.com'> <aw:Child1> <aw:GrandChild1> 阅读全文
posted @ 2024-09-18 17:19 echo-efun 阅读(146) 评论(0) 推荐(0)
摘要: static void Main(string[] args) { XElement purchaseOrder = XElement.Load("Contacts.xml"); string partNos = (string)(from item in purchaseOrder.Descend 阅读全文
posted @ 2024-09-18 17:09 echo-efun 阅读(64) 评论(0) 推荐(0)
摘要: using System.Xml.Linq; static void Main(string[] args) { XElement contacts = new XElement("Contacts", new XElement("Contact", new XElement("Name", "Pa 阅读全文
posted @ 2024-09-18 16:10 echo-efun 阅读(42) 评论(0) 推荐(0)
摘要: 网卡部分高级设置 1.节能以太网 Energy Efficient Ethernet 2.自动关闭Gigabit Automatically Close Gigabit 3.电量低时降低网络速度 Reduce Speed On Power Down 4.流控制 Flow Control 5.千兆主从 阅读全文
posted @ 2024-09-18 15:38 echo-efun 阅读(1337) 评论(0) 推荐(0)
摘要: 1.查询一定范围数字 static void QueryInt() { // Specify the data source. int[] scores = { 97, 92, 81, 60 }; // Define the query expression. IEnumerable<int> sc 阅读全文
posted @ 2024-09-18 13:55 echo-efun 阅读(43) 评论(0) 推荐(0)
摘要: Invoke是同步更新,会阻塞所在工作者线程,而BeginInvoke是异步更新,不会阻塞当前线程 阅读全文
posted @ 2024-08-26 13:38 echo-efun 阅读(37) 评论(0) 推荐(0)
摘要: public static void Main() { List<int>? numbers = null; int? a = null; Console.WriteLine((numbers is null)); //true // 如果numbers为空,则初始化numbers,同时添加一个5到 阅读全文
posted @ 2024-08-23 16:33 echo-efun 阅读(51) 评论(0) 推荐(0)
摘要: public static async Task Main() { Task<int> downloading = TaskAsync(); Console.WriteLine($"{nameof(Main)}: A"); int bytesLoaded = await downloading; C 阅读全文
posted @ 2024-08-23 16:06 echo-efun 阅读(45) 评论(0) 推荐(0)
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 21 下一页