Delphi 응답 Html

procedure TForm1.WebBrowser1BeforeNavigate2(ASender: TObject;
const pDisp: IDispatch; var URL, Flags, TargetFrameName, PostData,
Headers: OleVariant; var Cancel: WordBool);
var
myurl,tstr:string;
Stpos,len:Integer;
begin
if WebBrowser1.ReadyState=READYSTATE_COMPLETE then  //          
begin
myurl:=string(URL);                 //  URL
Stpos:=LastDelimiter('#',myurl);    //  URL  #       
len:=Stpos-1;                       //      
tstr:=Copy(myurl,stpos+1,len);      //        
//           
if tstr='caigou' then
begin
ShowMessage('caigou');
Cancel:=True;
Exit;
end;
if tstr='caiwu' then
begin
ShowMessage('caiwu');
Cancel:=True;
Exit;
end;
if tstr='xiaoshou' then
begin
ShowMessage('xiaoshou');
Cancel:=True;
Exit;
end;
if tstr='cangku' then
begin
ShowMessage('cangku');
Cancel:=True;
Exit;
end;
if tstr='renshi' then
begin
ShowMessage('renshi');
Cancel:=True;
Exit;
end;
end;
end;

좋은 웹페이지 즐겨찾기