'; sys02='
sys04='
'; sys05=' | '; var
tmpstr,str1:string;
j:integer;
vFileStream:TFileStream;
http:tidhttp;
begin
http:=tidhttp.Create(nil);
tmpstr:=http.Get('http://weather.news.sohu.com/citymake.php?city='+City);
j:=pos(sys01,tmpstr);
tmpstr:=copy(tmpstr,j,length(tmpstr));
j:=pos(sys02, tmpstr);
tmpstr:=copy(tmpstr,j+length(sys02),length(tmpstr));
j:=pos(sys03,tmpstr);
str1:=copy(tmpstr,0,j-1);
//下载图片
vFileStream:=TFileStream.Create(ExtractFilePath(application.ExeName)+'/weather.jpg',fmCreate,fmShareDenyNone);
try
//IdHTTP1.Get('http://173.16.80.26/inputdb.mdb',vFileStream);
HTTP.Get(str1,vFileStream);
//mage1.Picture.Bitmap.LoadFromStream(vfilestream);
finally
vFileStream.Free;
end;//try..finally
{sleep(1000);
image1.Picture.LoadFromFile( ExtractFilePath(application.ExeName)+'/weather.jpg');
}
j:=pos(sys04,tmpstr);
tmpstr:=copy(tmpstr, j+length(sys04),length(tmpstr));
j:=pos(sys05,tmpstr);
str1:=copy(tmpstr,0,j-1);
str1:=stringreplace(str1,' ','',[rfreplaceall]);
str1:=stringreplace(str1,chr(13),'',[rfreplaceall]);
str1:=stringreplace(str1,chr(10),'',[rfreplaceall]);
str1:=stringreplace(str1,'
',' ',[rfreplaceall]);
http.Free;
result:=str1;
end;