C# 多线程传递多个参数

http://www.cnblogs.com/lvdongjie/p/5416883.html

3. 方式三:采用lambda表达式

对于lambda表达式不熟悉的可以查看微软MSDN上的说明文档。此处假设你熟悉。因为在大多数使用委托的时候我们一般也可以用lambda表达式的。

 View Code
using System;
 using System.Threading;
  
 namespace ThreadWithParameters
 {
     class Program
     {
         static void Main(string[] args)
         {
             string hello = "hello world";
  
             //如果写成Thread thread = new Thread(ThreadMainWithParameters(hello));这种形式,编译时就会报错
             Thread thread = new Thread(() => ThreadMainWithParameters(hello));
             thread.Start();
  
             Console.Read();
         }
  
         static void ThreadMainWithParameters(string str)
         {
              Console.WriteLine("Running in a thread,received: {0}", str);
         }
     }
 }


原文地址:https://www.cnblogs.com/LuoEast/p/7753831.html