///////下面是取得超连接个数的一个例子,你改进一下就可以procedure TForm1.Button1Click(Sender: TObject);
var
  i,start1,count:integer;
  FileNote:Tstringlist;
begin
  count:=0;
  FileNote:=TStringList.Create;
  FileNote.LoadFromFile('f:\myapp\t2\aa.htm');
  for i:=0 to FileNote.Count-1 do
  begin
  Label1.Caption:=inttostr(strlen(FileNote.GetText));
  start1:=pos('href=',FileNote.Strings[i]);
  if (start1<>0) then
    count:=count+1;
  Memo1.Lines.Add(FileNote.Strings[i]);
  end;
  showMessage('文件的总共有:'+inttostr(count)+'个超连接');
  FileNote.Free;
end;