Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Delphi response Html

Shulou Source: shulou.com Published: 2022-06-03 07:41:09 11月23日 Update

Procedure TForm1.WebBrowser1BeforeNavigate2 (ASender: TObject;const pDisp: IDispatch; var URL, Flags, TargetFrameName, PostData,Headers: OleVariant; var Cancel: WordBool); varmyurl,tstr:string;Stpos,len:Integer;beginif WebBrowser1.ReadyState=READYSTATE_COMPLETE then / / determine whether the page has loaded beginmyurl:=string (URL); / / get URLStpos:=LastDelimiter ('#', myurl); / / get the number of # backward characters in URL len:=Stpos-1 / / character length minus one tstr: = Copy (myurl,stpos+1,len); / / subcharacters after combined filtering / / determine which link the user clicked on if tstr='caigou' thenbeginShowMessage ('caigou'); Cancel:=True;Exit;end;if tstr='caiwu' thenbeginShowMessage (' caiwu'); Cancel:=True;Exit;end;if tstr='xiaoshou' thenbeginShowMessage ('xiaoshou'); Cancel:=True;Exit;end;if tstr='cangku' thenbeginShowMessage (' cangku') Cancel:=True;Exit;end;if tstr='renshi' thenbeginShowMessage ('renshi'); Cancel:=True;Exit;end;end;end

Tags: Character number user link length page combination Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn Redmi Microsoft MariaDB MySQL