我創造,我需要運行然後移動創建在Delphi使用的GetTickCount
procedure firstTimeRun(const document: IHTMLDocument2);
var
fieldValue : string;
StartTime : Dword;
begin
StartTime := GetTickCount();
WebFormSetFieldValue(document, 0, 'Username', '*******');
WebFormSetFieldValue(document, 0, 'Password', '*******');
WebFormSubmit(document, 0);
if (GetTickCount() >= StartTime+ 600000) then
begin
SecondRun();
end;
end;
我的問題是,當我到達if語句,它會檢查看到之前等待10分鐘的過程等待這是不是真的,並繼續前進,我如何讓它留下來,等到聲明是真的?
你不能使用TTimer嗎? –
請注意,如果您在主線程中執行此操作,它將阻止UI(10分鐘!)。如果是這樣,不要使用建議的方式,也不要試圖通過調用「Application.ProcessMessages」來「修復」該塊。 – TLama