Delphi response Html
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