
使用前必須先Using
System.Threading
System.Threading.Tasks
這兩個NameSpace
簡單範例:
....
Parallel.Invoke(
() => MethodA(),
() => MethodB(),
() => MethodC() );
....
private void MethodA()
{
MessageBox.Show("This is Method A");
}
private void MethodB()
{
MessageBox.Show("This is Method B");
}
private void MethodC()
{
MessageBox.Show("This is Method C");
}
相關文章:
http://msdn.microsoft.com/zh-tw/dd996613.aspx
http://msdn.microsoft.com/en-us/concurrency/default.aspx
http://msdn.microsoft.com/en-us/library/dd460693(VS.100).aspx

沒有留言:
張貼留言