首页 > 代码库 > delphi 7 获取当前网址并解决乱码问题

delphi 7 获取当前网址并解决乱码问题

 

const Url = ‘http://del.cnblogs.com‘;

procedure Tidhttptestform.Button1Click(Sender: TObject);
var
stream:TStringStream;
idHttpObj:TIdHTTP;
begin
stream := TStringStream.Create(‘‘);

idHttpObj := TIdHTTP.Create(nil);
idHttpObj.Get(Url, stream);

idHttpObj.Free;
//乱码转化
//Memo1.Lines.Text := UTF8Decode(stream.DataString);
ShowMessage(UTF8Decode(stream.DataString));
stream.Free;
end;

delphi 7 获取当前网址并解决乱码问题