delphi 从网址链接中提取域名


本文整理自网络,侵删。

 
 function GetHost(TheURL: string): String;
  var
    FURL: String;
  begin
    FURL := TheURL + '555';
    if pos(UpperCase('http://'), UpperCase(FURL)) > 0 then
    begin
      Delete(FURL, 1, Length('http://'));
    end;
    Result := Copy(FURL, 1, pos('/', FURL) - 1);
  end;

procedure TForm1.Button1Click(Sender: TObject);
begin
showmessage(GetHost('http://www.3464.com/tools/'));
end;

相关阅读 >>

Delphi tadoquery 中文使用说明

Delphi adoconnection1 事务

Delphi urunpe

Delphi中始终用webbrowser打开网页

Delphi提示‘error loading midas.dll’的原因及解决方案

Delphi dectobinstr

Delphi tidhttp 超时设置无效的解决方法

Delphi整理一(基础知识)

Delphi 农历源码

Delphi restfull api调用方法

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...