Saturday, 28 September 2013

Update WebBrowser in Delphi

Update WebBrowser in Delphi

Hi I am making a web browser in delphi, so for now I'm doing is letting
the user can modify the headers at will, the current problem is that I use
a checkbox to check when the user wants to use the headers that are in a
memo the problem is that when I use it for the first time it works fine
but when I disable the checkbox and try to use the browser without the
headers is that the headers are still active and that should not be
happening.
The code page used to test local
<? php
$ nav = $ _SERVER ['HTTP_USER_AGENT'];
echo "<h1> Test:". $ nav. "</ h1>";
?>
The code delpi
TForm2.sButton1Click procedure (Sender: TObject);
var
Flags, Headers, targetFrameName, PostData: OleVariant;
Url, Ref: string;
begin
Flags: = '1 ';
TargetFrameName: ='';
PostData: ='';
URL: = sEdit1.Text;
if (sCheckBox1.Checked) then
begin
Headers: = sMemo1.Text;
WebBrowser1.Navigate (URL, Flags, targetFrameName, PostData, Headers);
end
else
begin
Headers: ='';
WebBrowser1.Navigate (URL, Flags, targetFrameName, PostData, Headers);
end;
end;

No comments:

Post a Comment