摘要:
using System; // 发布者:订单 public class Order { // 事件:带 string 参数(订单号) public event Action OrderFinished; // 完成订单 public void Finish() { Console.WriteLin 阅读全文
摘要:
using System; using System.Threading.Tasks; class Program { // 共享变量(多个线程都会改它) static int count = 0; static void Main() { // 两个线程同时 count++ Task t1 = T 阅读全文
摘要:
using System; using System.Threading; using System.Windows.Forms; namespace CrossThreadDemo { public partial class Form1 : Form { // 执行顺序1:窗体加载 public 阅读全文
摘要:
using System; using System.Threading; class Program { static void Main() { // 执行顺序 1:创建线程,传入参数 Thread t = new Thread(PrintMsg); // 执行顺序 2:启动线程,并把 "我是参 阅读全文