📄 thread_unit3.pas
字号:
unit thread_Unit3;
interface
uses
Classes,define_Unit,SysUtils,StrUtils;
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;
s1,ss,aa:string;
begin
if form_main.door_check.Checked then //URL的过滤 ,由根目录开始扫描
begin
URL:=trim(Form_main.ScanURL.Text);
s1:=copy(URL,8,length(URL)-7);
if (pos('http://',URL)=1) and (pos('/',s1)>1) then
begin
aa:=copy(URL,8,length(URL)-7);
ss:=copy(aa,1,pos('/',aa));
URL:='http://'+ss;
end
else if (pos('http://',URL)=1) and (pos('/',s1)<1) then
begin
URL:=URL+'/' ;
end
else if (pos('http://',URL)<1)and (pos('/',s1)>1) then
begin
ss:=copy(URL,1,pos('/',URL));
URL:='http://'+ss;
end
else if (pos('http://',URL)<1)and (pos('/',s1)<1) then
begin
URL:=URL+'/';
end;
end
else //直接扫描URL
begin
URL:=trim(Form_main.ScanURL.Text);
if pos('http://',URL)=1 then
begin
if RightStr(URL,1)='/' then
URL:=URL
else
URL:=URL+'/';
end
else
begin
if RightStr(URL,1)='/' then
URL:='http://'+URL
else
URL:='http://'+URL+'/';
end;
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.GetURLCode(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 + -