public void Init_Seg_Sub() { pSeg = new C_Segmentation(); pSeg.pTreapWord = new C_Treap_Funny <Treap <C_Word_Seg> >(); //网络的词汇 ArrayList pList = S_Dir.ListFile(Seg_Path + "\\"); for (int i = 0; i < pList.Count; i++) { string strFile = Seg_Path + "\\" + pList[i]; if (strFile.EndsWith(".txt")) { StreamReader pReader = S_File_Text.Read_Begin(strFile); string strLine = ""; while (pReader.Peek() != -1) { strLine = S_File_Text.Read_Line(pReader); pSeg.readLine_fromDic(strLine); } } } pFrmApp.Call_Event(this.callback_init, ""); }
public void setTimeout(string strFunction, int iSec, string memo) { var t = Task.Run(async delegate { Console.WriteLine("iSec秒"); await Task.Delay(1000 * iSec); if (strFunction.Equals("check_connected")) { Console.WriteLine("iSec秒后会执行此输出语句"); } else { Console.WriteLine("iSec秒后会执行此输出语句"); } pFrmApp.Call_Event(strFunction, memo); }); }