外貿(mào)做的社交網(wǎng)站營(yíng)銷網(wǎng)絡(luò)推廣方式有哪些
?創(chuàng)建無(wú)參數(shù)線程是無(wú)法發(fā)去傳遞參數(shù)的,需要把 《 thread.Start(“張三”);? 》改為《 thread.Start();? 》 把參數(shù)去掉就可以了。
public RegisterWindow(){InitializeComponent();//無(wú)參數(shù)線程Thread thread = new Thread(pageLoad);thread.IsBackground = true;//thread.Start(“張三”);thread.Start(); }public void pageLoad(){//要執(zhí)行的代碼}
創(chuàng)建有參數(shù)線程:使用 ParameterizedThreadStart委托實(shí)現(xiàn)
public RegisterWindow(){InitializeComponent();//創(chuàng)建參數(shù)化線程Thread thread = new Thread(new ParameterizedThreadStart(pageLoad));thread.IsBackground = true;//可以傳遞任意類型的數(shù)據(jù) 例如:int,string,list,array等thread.Start(“張三”);}/// <summary>/// 參數(shù)化線程方法/// </summary>/// <param name="o">傳遞過(guò)來(lái)的參數(shù)會(huì)變成object類型的</param>public void pageLoad(object o){//要執(zhí)行的代碼}