반응형
여기 저기 찾다 Navigate2를 이용하는 것을 찾았습니다.
혹 다른분을 위해 소스를 올립니다.
===================
uses ComObj;
procedure TDlgRegisterPC.OnlineRegist(const AUID, AFlag: string);
var
WebBrowser1: Variant;
WebAddr, VPostData, VFlags, VFrame, VHeaders: OleVariant;
iLoop: Integer;
PostData: string;
begin
PostData := 'UID=' + AUID + '&Flag=' + AFlag;
WebBrowser1 := CreateOleObject('InternetExplorer.Application');
if Length(PostData)> 0 then
begin
VHeaders := 'Content-Type: application/x-www-form-urlencoded'+ #10#13#0;
VPostData := VarArrayCreate([0, Length(PostData)], varByte);
for iLoop := 0 to Length(PostData)- 1 do
begin
VPostData[iLoop] := Ord(PostData[iLoop+ 1]);
end;
VPostData[Length(PostData)] := 0;
TVarData(VPostData).vType := varArray;
end;
VFlags := 0;
WebAddr := Config.OnlineRegist;
WebBrowser1.Navigate2(WebAddr, VFlags, VFrame, VPostData, VHeaders);
WebBrowser1.Visible := True;
end;
혹 다른분을 위해 소스를 올립니다.
===================
uses ComObj;
procedure TDlgRegisterPC.OnlineRegist(const AUID, AFlag: string);
var
WebBrowser1: Variant;
WebAddr, VPostData, VFlags, VFrame, VHeaders: OleVariant;
iLoop: Integer;
PostData: string;
begin
PostData := 'UID=' + AUID + '&Flag=' + AFlag;
WebBrowser1 := CreateOleObject('InternetExplorer.Application');
if Length(PostData)> 0 then
begin
VHeaders := 'Content-Type: application/x-www-form-urlencoded'+ #10#13#0;
VPostData := VarArrayCreate([0, Length(PostData)], varByte);
for iLoop := 0 to Length(PostData)- 1 do
begin
VPostData[iLoop] := Ord(PostData[iLoop+ 1]);
end;
VPostData[Length(PostData)] := 0;
TVarData(VPostData).vType := varArray;
end;
VFlags := 0;
WebAddr := Config.OnlineRegist;
WebBrowser1.Navigate2(WebAddr, VFlags, VFrame, VPostData, VHeaders);
WebBrowser1.Visible := True;
end;
반응형