C#
lz_煜
这个作者很懒,什么都没留下…
展开
-
多线程(1-6 Thread 续)
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading;namespace 多线程{ //1:Thred //最简单、最原始的使用方法:Thread oGetArgThread = new Thread(new ThreadStart(() =>{});这种用法应该大多数人都使用过,参数为一个ThreadStart类型的原创 2021-11-25 22:13:53 · 567 阅读 · 0 评论 -
多线程(1-6 Thread)(c#)
多线程(1-6 Thread)using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading;namespace ThreadClass{ class Program { static void Main(string[] args) { #region 控制线程原创 2021-11-25 22:10:37 · 804 阅读 · 0 评论 -
多线程(1-5 ParallelUse)(c#)
多线程(1-5 ParallelUse)using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading;using System.Threading.Tasks;namespace ParallelUse{ class Program { /// <summary> /// Paral原创 2021-11-25 22:06:50 · 353 阅读 · 0 评论 -
多线程(1-4-Task)(c#)
多线程(1-4-Task)using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Threading;/* 1:可以看到Task和Thread一样,位于System.Threading命名空间下; 2:两种方式创建两个task,并让他们运行。可以看到通过构造函数创建的task,必须手动Start,而原创 2021-11-25 22:02:23 · 734 阅读 · 0 评论 -
多线程(1-3)(c#)
多线程(1-3)using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading;namespace Multithreading{ class Program { public delegate int TakesAWhileDelegate(int data, int ms); //定义委托 sta原创 2021-11-25 21:55:30 · 295 阅读 · 0 评论 -
多线程(1-2)(c#)
多线程(1-2)class Program { static void Main(string[] args) { //btnSync_Click(); //同步 btnAsync_Click(); //异步 Console.Read(); } public delegate void DoNothing(string name);原创 2021-11-25 21:51:31 · 898 阅读 · 0 评论 -
多线程(1-1)(c#)
多线程(1-1)/// 1 进程-线程-多线程,同步和异步/// 2 委托启动异步调用/// 3 多线程特点:不卡主线程、速度快、无序性/// 4 异步的回调和状态参数/// 5 异步等待三种方式/// 6 异步返回值////// 进程-线程 计算机概念/// 进程是一个程序在电脑上运行时,全部计算资源的合集叫进程/// 线程是程序的最小执行单位,包含计算资源,任何一个操作的响应都是线程完成的/// 多线程:多个线程并发执行/// Thread:是.Net框架封装的一个类,描述线程原创 2021-11-25 21:43:21 · 97 阅读 · 0 评论 -
c# 多线程
Enumerable.Range(0, allBlock).AsParallel().ForAll(i =>{ ......});) Task.Factory.StartNew(new Action(() =>{ ........}));原创 2021-09-26 16:03:34 · 98 阅读 · 0 评论 -
c# 定时器
private DispatcherTimer _timer = new DispatcherTimer();_timer.Tick += Timer_Elapsed;_timer.Interval = TimeSpan.FromSeconds(1);_timer.Start(); private void Timer_Elapsed(object sender, object e) { ...... }原创 2021-09-26 15:58:15 · 103 阅读 · 0 评论 -
xml文件读写(C#)
```markup```handlebars<?xml version="1.0" encoding="utf-8"?><PETGantrySimulator> <Product type="uMI550"> <ScanMode type="Coincidence"> <SystemStatus>D:\UIH\appdata\MI\Simulator\PETGantry\Data\uMI550\Co原创 2020-07-17 17:43:55 · 119 阅读 · 0 评论