摘要: int[] nums = new int[] { 3, 5, 21, 53, 99, 43, 37, 29, 2 }; IEnumerable<int> result = nums.Where(a => a > 10); foreach(int num in result) { Console.Wr 阅读全文
posted @ 2022-08-26 16:35 NangFah 阅读(39) 评论(0) 推荐(0)
摘要: static void Main(string[] args) { //LINQ简化 Action<string> f1 = s => Console.WriteLine(s); //委托 Action<string> f11 = delegate (string s) { Console.Writ 阅读全文
posted @ 2022-08-26 16:24 NangFah 阅读(25) 评论(0) 推荐(0)
摘要: 异步方法下载指定网址,如果下载失败则稍等500ms在重试,如果三次都失败就停止下载,抛出下载失败 代码: using System.Timers; class Program { public static System.Timers.Timer timer = new System.Timers. 阅读全文
posted @ 2022-08-26 15:24 NangFah 阅读(73) 评论(0) 推荐(0)