(一)
由於線程只能執行無參數方法
此示例演示怎樣借助封裝類實現
(二)
using System;
using System
namespace 借助封裝類實現_線程調用帶參方法_
{
class Help
{
public int x =
public int y =
public int end =
}
class MyClass
{
public static Help myHelp = new Help();
[STAThread]
static void Main(string[] args)
{
//給類的成員賦值
myHelp
myHelp
Thread thread = new Thread(new ThreadStart(GetAccumulate));
thread
Thread
Console
Console
}
///
/// 得到兩個整數的集
///
///
乘數x
///
乘數y
///
public static void GetAccumulate()
{
myHelp
}
}
}
本示例代碼已經測試
(三)
From:http://tw.wingwit.com/Article/program/net/201311/13084.html