本文整理自网络,侵删。
RStream := TStringStream.Create('');
self.IdHTTP1.Request.Host := '192.168.3.198';
self.IdHTTP1.Request.UserAgent := 'Mozilla/5.0 (Windows; U; Windows NT 6.1 zh-CN; rv:1.9.2.10) Gecko/20100914 Firefox/3.6.10';
self.IdHTTP1.Request.Accept := 'text/html,application/xhtml+xml, application/xml;q=0.9,*/*;q=0.8';
self.IdHTTP1.Request.AcceptLanguage := 'zh-cn,zh,q=0.5';
self.IdHTTP1.Request.AcceptEncoding := 'gzip,deflate';
self.IdHTTP1.Request.AcceptCharSet := 'GB2312,utf-8;q=0.7,*;q=0.7';
self.IdHTTP1.Request.Connection := 'keep-alive';
self.IdHTTP1.Request.BasicAuthentication := true;
self.IdHTTP1.Request.Username := 'admin';
self.IdHTTP1.Request.Password := 'voip';
self.IdHTTP1.Request.Referer := 'http://192.168.3.198/submenu.htm';
self.IdHTTP1.Get('http://192.168.3.198/main.htm', RStream);
self.Memo1.Text := RStream.DataString;
相关阅读 >>
Delphi 泛型容器单元(generics.collections) tdictionary<t>
更多相关阅读请进入《Delphi》频道 >>