多线程
定义两个函数,分别输入数据与字母,各输10次,要求使用线程输出
[解决办法]
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
namespace ToHelp2
{
class Program
{
static void Main(string[] args)
{
Thread td1 = new Thread(new ParameterizedThreadStart(OutChristcrossRow));
td1.Start('A');
Thread td2 = new Thread(new ParameterizedThreadStart(OutPutData));
td2.Start('1');
Thread.Sleep(10000);
}
private static void OutChristcrossRow(object ChristcrossRow)
{
for (int i = 0; i < 10; i++)
{
Console.Write(ChristcrossRow.ToString());
}
}
private static void OutPutData(object data)
{
for (int i = 0; i < 10; i++)
{
Console.Write(data.ToString());
}
}
}
}