Delphi中,怎么查找字符串?

来源:百度知道 编辑:UC知道 时间:2024/05/14 04:27:00
比如:您访问过:百度一下,你就知道 URL:http://www.baidu.com/ Time:2009-3-21 20:36:32

那么我要他帮我把http://www.baidu.com/查找出来显示在Combobox上面
应该怎么做?
假如 不是那网站 是另外一个网站 那么我该怎么做? 能说详细点更好了`

用pos()和copy()吧,
i:integer;
s:='URL:http://www.baidu.com/ Time:2009-3-21 20:36:32 ';
i:=pos('http://www.baidu.com/',s);
s1:=copy(s,i,length(s));
comobobox.items.add(s1);

s:=trim(GetWebPage('http://www.baidu.com'));
这个函数可把网页内容赋值给S
function TF_faceslogin.GetWebPage(const Url: string):string;
var
Session,
HttpFile:HINTERNET;
szSizeBuffer:Pointer;
dwLengthSizeBuffer:DWord;
dwReserved:DWord;
dwFileSize:DWord;
dwBytesRead:DWord;
Contents:PChar;
begin
Session:=InternetOpen('',0,niL,niL,0);
HttpFile:=InternetOpenUrl(Session,PChar(Url),niL,0,0,0);
dwLengthSiz