PostData用于向页面提交信息,如'animal=cat&color=brown'
procedure TDBModule.Navigate(stURL, stPostData: String; var wbWebBrowser: TWebBrowser);
var
vWebAddr, vPostData, vFlags, vFrame, vHeaders: OleVariant;
iLoop: Integer;
begin
{Are we posting data to this Url?}
if Length(stPostData)> 0 then
begin
{头信息当PostData使.}
vHeaders:= 'Content-Type: application/x-www-form-urlencoded'+ #10#13#0;
vPostData:= VarArrayCreate([0, Length(stPostData)], varByte);
for iLoop := 0 to Length(stPostData)- 1 do
begin
vPostData[iLoop]:= Ord(stPostData[iLoop+ 1]);
end;
{结束字符}
vPostData[Length(stPostData)]:= 0;
{Set the type of Variant, cast}
TVarData(vPostData).vType:= varArray;
end;
vWebAddr:= stURL;
wbWebBrowser.Navigate2(vWebAddr, vFlags, vFrame, vPostData, vHeaders);
end;
再骗100就收手了