码迷,mamicode.com
首页 > 其他好文 > 详细

ParameterizedThreadStart

时间:2018-01-09 18:37:03      阅读:160      评论:0      收藏:0      [点我收藏+]

标签:dstar   public   输入参数   oid   color   read   tar   reads   gpo   

ParameterizedThreadStart 可接受输入参数。

如果函数需要输入一个或多个参数,则需ParameterizedThreadStart来启用进程。

 1 using System;  
 2 using System.Threading;  
 3 public class Work  
 4 {  
 5     public static void Main()  
 6     {  
 7       Thread newThread = new Thread(  
 8                          new ParameterizedThreadStart(doWork)  
 9                          );  
10       newThread.start("456");  
11 
12       public static void doWork(object ob)  
13       {  
14         Console.WriteLine("123" + ob.ToString());  
15       }  
16 
17     }  
18 }  

 

ParameterizedThreadStart

标签:dstar   public   输入参数   oid   color   read   tar   reads   gpo   

原文地址:https://www.cnblogs.com/myself666/p/8252701.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!