1,593
社区成员
发帖
与我相关
我的任务
分享
procedure TForm1.Button6Click(Sender: TObject);
var
ResponseStream:TStringStream;
begin
ResponseStream:=TStringstream.Create('',936);
IdHTTP1.Get('http://www.118100.cn/action/secweborder/isCTMobile.do?mobile=' + edit1.Text,ResponseStream);
//这是UTF-8网页
memo1.Lines.Add(UTF8Decode(ResponseStream.DataString));
Freeandnil(ResponseStream);
end;
rocedure TForm2.Button1Click(Sender: TObject);
var
ResponseStream: TStringStream;
i: integer;
URL: string;
begin
ResponseStream := TStringstream.Create('', 936);
IdHTTP1.Request.AcceptEncoding := 'identity';
URL := 'http://www.118100.cn/action/secweborder/isCTMobile.do?mobile=' + edit1.Text;
IdHTTP1.Get(URL, ResponseStream);
Memo1.Lines.Add('-------------------------');
Memo1.Lines.Add(URL);
// 这里不再需要对UTF8解码,因为它本来就不是UTF8
Memo1.Lines.Add(ResponseStream.DataString);
Freeandnil(ResponseStream);
end;