📄 thread_unit3.~pas
字号:
unit thread_Unit3;
interface
uses
Classes,define_Unit,SysUtils,dialogs;
type
MyThread = class(TThread)
public
procedure Execute; override;
private
{ Private declarations }
protected
//procedure Execute; override;
end;
implementation
uses
Main_Unit;
{ Important: Methods and properties of objects in visual components can only be
used in a method called using Synchronize, for example,
Synchronize(UpdateCaption);
and UpdateCaption could look like,
procedure MyThread.UpdateCaption;
begin
Form1.Caption := 'Updated in a thread';
end; }
{ MyThread }
procedure MyThread.Execute;
var
MyDictAdmin:TextFile;
Str:String;
URL:String;
begin
URL:=trim(Form_main.ScanURL.Text);
if Pos('http://',URL)=1 then
begin
if Pos('/',copy(URL,8,length(URL)-7)>1 then
URL:=trim(Form_main.ScanURL.Text)
else
URL:=URL+'/';
end
else
begin
if Pos('/',URL)>0 then
URL:='http://'+trim(Form_main.ScanURL.Text)
else
URL:='http://'+trim(Form_main.ScanURL.Text)+'/';
end;
AssignFile(MyDictAdmin,'MyDictAdmin.txt');
Reset(MyDictAdmin);
try
while not Eof(MyDictAdmin) do
begin
if main_unit.stop then
exit;
Readln(MyDictAdmin,Str);
case define_Unit.GetURL(trim(URL+Str)) of
200:
begin
Form_main.Memo1_Addr.Items.Add(trim(URL+Str)+'['+inttostr(200)+']');
Form_main.Memo2_Addr.Items.Add(trim(URL+Str));
end;//end of begin
404:Form_main.Memo1_Addr.Items.Add(trim(URL+Str)+'['+inttostr(404)+']');
403:
begin
Form_main.Memo1_Addr.Items.Add(trim(URL+Str)+'['+inttostr(403)+']');
Form_main.Memo2_Addr.Items.Add(trim(URL+Str));
end;
302:Form_main.Memo1_Addr.Items.Add(trim(URL+Str)+'['+inttostr(302)+']');
500:Form_main.Memo1_Addr.Items.Add(trim(URL+Str)+'['+inttostr(500)+']');
end;//end of case
end;//end of begin
finally
CloseFile(MyDictAdmin);
end;//end of try
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -