0
点赞
收藏
分享

微信扫一扫

C#编程-146:最简单的开启线程_彭世瑜_新浪博客

编程练习生J 2022-04-02 阅读 87


  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading;
  6. namespace ThreadingTest
  7. {
  8.     class Program
  9.     {
  10.         public static void method()
  11.         {
  12.             for (int i = 101; i <=990; i++)
  13.             {
  14.                 if (i % 10 == 0) Console.WriteLine(i);
  15.                 else Console.Write(i+" ");
  16.             }
  17.         }
  18.         static void Main(string[] args)
  19.         {
  20.             ThreadStart ts = new ThreadStart(method);
  21.             Thread t = new Thread(ts);
  22.             t.Start();
  23.             Console.ReadLine();
  24.         }
  25.     }
  26. }
  27. C#编程-146:最简单的开启线程_彭世瑜_新浪博客_java​​


举报

相关推荐

0 条评论