摘要: title: 任务 date: 2022-12-09T14:42:36Z lastmod: 2022-12-09T14:55:09Z 任务 static void Main(string[] args) { TaskFactory tf = new TaskFactory(); Task t = t 阅读全文
posted @ 2023-10-04 15:54 天空之城00 阅读(15) 评论(0) 推荐(0)
摘要: title: 使用Thread启动线程和传输数据 date: 2022-12-05T19:14:18Z lastmod: 2022-12-05T19:31:59Z 使用Thread启动线程和传输数据 启动线程 static void Test() { Console.WriteLine("Test 阅读全文
posted @ 2023-10-04 15:54 天空之城00 阅读(20) 评论(0) 推荐(0)
摘要: title: 死锁问题 date: 2022-12-09T15:09:41Z lastmod: 2022-12-09T15:23:37Z 死锁问题 internal class StateObject { private Object _lock1 = new Object(); private O 阅读全文
posted @ 2023-10-04 15:54 天空之城00 阅读(11) 评论(0) 推荐(0)
摘要: title: 线程池 date: 2022-12-09T14:28:02Z lastmod: 2022-12-09T14:41:45Z 线程池 static void Main(string[] args) { for (int i = 0; i < 10; i++) { ThreadPool.Qu 阅读全文
posted @ 2023-10-04 15:53 天空之城00 阅读(17) 评论(0) 推荐(0)
摘要: title: 线程的优先级和线程的状态 date: 2022-12-05T19:57:50Z lastmod: 2022-12-05T20:18:53Z 线程的优先级和线程的状态 线程的优先级 在 Thread 类中,可以设置 Priority​ 属性,以影响线程的基本优先级,Priority​ 属 阅读全文
posted @ 2023-10-04 15:53 天空之城00 阅读(18) 评论(0) 推荐(0)
摘要: title: 异步委托的方式启动线程 date: 2022-12-05T19:03:24Z lastmod: 2022-12-05T19:11:59Z 异步委托的方式启动线程 static void Test() { Console.WriteLine("Test Started"); Consol 阅读全文
posted @ 2023-10-04 15:53 天空之城00 阅读(8) 评论(0) 推荐(0)
摘要: title: 资源访问冲突问题 date: 2022-12-09T14:56:10Z lastmod: 2022-12-09T15:09:16Z 资源访问冲突问题 internal class StateObject { private int state = 5; public void Chan 阅读全文
posted @ 2023-10-04 15:52 天空之城00 阅读(15) 评论(0) 推荐(0)
摘要: title: 自定义类传递数据和前台线程、后台线程 date: 2022-12-05T19:32:26Z lastmod: 2022-12-05T19:51:01Z 自定义类传递数据和前台线程、后台线程 internal class DowmloadTool { public string URL 阅读全文
posted @ 2023-10-04 15:52 天空之城00 阅读(14) 评论(0) 推荐(0)
摘要: title: FileInfo 和 DirectoryInfo date: 2022-12-09T15:24:08Z lastmod: 2022-12-09T16:12:53Z FileInfo 和 DirectoryInfo 通过 FileInfo​ 和 DirectoryInfo​ 类来读取文件 阅读全文
posted @ 2023-10-04 15:51 天空之城00 阅读(50) 评论(0) 推荐(0)
摘要: title: FileMode,FileAccess 的参数释义 date: 2022-12-09T16:20:46Z lastmod: 2022-12-09T16:21:17Z FileMode,FileAccess 的参数释义 首先,FileMode,FileAccess都是枚举类型。 一:Fi 阅读全文
posted @ 2023-10-04 15:51 天空之城00 阅读(389) 评论(0) 推荐(0)
摘要: title: 文本读取和写入流 date: 2022-12-10T11:04:15Z lastmod: 2022-12-10T11:30:02Z 文本读取和写入流 文本流的创建 直接创建 StreamReader reader = new StreamReader(@"E:\file.zip"); 阅读全文
posted @ 2023-10-04 15:51 天空之城00 阅读(18) 评论(0) 推荐(0)
摘要: title: 文件的读取和写入 date: 2022-12-09T15:59:55Z lastmod: 2022-12-09T16:16:14Z 文件的读取和写入 读取文件 方法 说明 ​File.ReadAllText(FilePath);​ 读取指定路径的文件 ​File.ReadAllText 阅读全文
posted @ 2023-10-04 15:50 天空之城00 阅读(33) 评论(0) 推荐(0)
摘要: title: 文件读取流和写入流 date: 2022-12-09T16:16:19Z lastmod: 2022-12-10T11:11:36Z 文件读取流和写入流 读写内存使用 System.IO.MemorySystem​ 处理网络数据使用 Net.Sockets.NetworkStream​ 阅读全文
posted @ 2023-10-04 15:50 天空之城00 阅读(6) 评论(0) 推荐(0)
摘要: title: TCP 和 UDP 的区别 date: 2022-12-10T13:40:31Z lastmod: 2022-12-10T13:43:14Z TCP 和 UDP 的区别 基于连接(TCP)和无连接(UDP) 对系统资源的要求(TCP 较多,UDP 少) UDP 程序结构较简单 流模式( 阅读全文
posted @ 2023-10-04 15:49 天空之城00 阅读(10) 评论(0) 推荐(0)
摘要: title: TCP 通信 date: 2022-12-10T11:31:21Z lastmod: 2022-12-10T12:15:37Z TCP 通信 TCP 服务端 Socket tcpServer = new Socket(AddressFamily.InterNetwork, Socket 阅读全文
posted @ 2023-10-04 15:49 天空之城00 阅读(23) 评论(0) 推荐(0)
摘要: title: UDP 通信 date: 2022-12-10T11:32:27Z lastmod: 2022-12-10T13:37:21Z UDP 通信 UDP 服务端 Socket udpServer = new Socket(AddressFamily.InterNetwork, Socket 阅读全文
posted @ 2023-10-04 15:49 天空之城00 阅读(7) 评论(0) 推荐(0)
摘要: title: DebuggerStepThrough 特性 date: 2022-12-05T18:26:14Z lastmod: 2022-12-05T18:36:36Z DebuggerStepThrough 特性 [DebuggerStepThrough] static void Test() 阅读全文
posted @ 2023-10-04 15:48 天空之城00 阅读(9) 评论(0) 推荐(0)
摘要: title: Obsolete 特性 date: 2022-12-05T18:13:27Z lastmod: 2022-12-05T18:22:44Z Obsolete 特性 [Obsolete] static void Test() { } ​[Obsolete]​ 特性:弃用 ​Obsolete 阅读全文
posted @ 2023-10-04 15:46 天空之城00 阅读(21) 评论(0) 推荐(0)
摘要: title: 调用者信息特性 date: 2022-12-05T18:26:48Z lastmod: 2022-12-05T18:34:37Z 调用者信息特性 static void ShowMessage(string message, [CallerLineNumber] int lineNum 阅读全文
posted @ 2023-10-04 14:48 天空之城00 阅读(9) 评论(0) 推荐(0)
摘要: title: 自定义特性和使用 date: 2022-12-05T18:37:02Z lastmod: 2022-12-05T19:02:07Z 自定义特性和使用 什么是特性 特性(attribute)是一种允许我们向程序的程序集增加元数据的语言结构,它是用于保存程序结构信息的某种特殊类型的类。 将 阅读全文
posted @ 2023-10-04 14:48 天空之城00 阅读(18) 评论(0) 推荐(0)