本文整理自网络,侵删。
program Project1;
{$APPTYPE CONSOLE}
{$R *.res}
uses System.SysUtils, System.Classes, System.Net.HttpClient, System.RegularExpressions;
const url = 'http://www.delphitop.com/';begin var http := THttpClient.Create; var sl := TStringList.Create; try sl.LoadFromStream(http.Get(url).ContentStream, TEncoding.ANSI); var m := TRegEx.Match(sl.Text, '<title>(.*?)</title>'); if m.Success then writeln('获取信息: ', m.Value); Readln; finally sl.Free; http.Free; end;end.
相关阅读 >>
Delphi cef4Delphi chromium1 设置user-agent
Delphi firedac 下的 sqlite [11] - 关于批量提交 sql 命令的测试
更多相关阅读请进入《Delphi》频道 >>