2010年12月16日 星期四

測試程式執行次數

載點
https://docs.google.com/uc?id=0B4PwTcFHZPWbNTEwMTdhOWMtMDRjOS00M2RmLWFlNWQtMGQ5ZTUxMzg2MTcx&export=download&hl=zh_TW

外觀

關鍵程式碼:
void __fastcall TForm1::Timer1Timer(TObject *Sender)
{
  STARTUPINFO si;
  PROCESS_INFORMATION pi;
  ZeroMemory(&si,sizeof(si));
  si.cb=sizeof(si);
  ZeroMemory(&pi,sizeof(pi));
  CreateProcess(exepath.c_str(),NULL,NULL,NULL,FALSE,0,NULL,NULL,&si,&pi);
  n++;
  Label1->Caption=n;
  if(n==Edit3->Text.ToInt())
  {
    Timer1->Enabled=false;
    Label1->Font->Color=clRed;
    Label1->Caption="Test Over";
  }
}
//---------------------------------------------------------------------------
使用Timer 讓要測試的執行檔能在選擇的秒數後啟動

沒有留言:

張貼留言