Hi,
Gute Neuigkeiten !
Ich habe die Browser-Komponente entfernt und wie von
himitsu vorgeschlagen
idHTTP genommen:
Delphi-Quellcode:
function URLEncode(
const ASrc:
string):
string;
var
i: Integer;
const
UnsafeChars = ['
*', '
#', '
%', '
<', '
>', '
','
[','
]'];
{do not localize}
begin
Result := '
';
{Do not Localize}
for i := 1
to Length(ASrc)
do
begin
if (ASrc[i]
in UnsafeChars)
or (
not (ord(ASrc[i])
in [33..128]))
then
begin {do not localize}
Result := Result + '
%' + IntToHex(Ord(ASrc[i]), 2);
{do not localize}
end
else
begin
Result := Result + ASrc[i];
end;
end;
end;
procedure TForm4.Button1Click(Sender: TObject);
var
aStream: TMemoryStream;
Params: TStringStream;
begin
button1.Caption:='
please wait';
aStream := TMemoryStream.create;
Params := TStringStream.create('
');
try
with IdHTTP1
do
begin
//Params.WriteString(URLEncode('user=' + Edit1.Text + '&'));
//Params.WriteString(URLEncode('pass=' + Edit2.Text));
// You can change headers like this:
Request.ContentType := '
application/x-www-form-urlencoded';
try
Response.KeepAlive := False;
Post('
http://www.dragonlords.info/dev/big.xml', Params, aStream);
except
on E:
Exception do
showmessage('
Error encountered during POST: ' + E.
Message);
end;
end;
aStream.WriteBuffer(#0'
', 1);
aStream.Position := 0;
Memo1.Lines.LoadFromStream(aStream);
button1.Caption:='
done';
except
aStream.Free;
Params.Free;
end;
end;
Die Ladezeit ist die selbe, aber diese Aktion "kostet" gerade mal 15MB !