//以流的方式提交参数 // RequestStream.WriteString('kjhm='); // IdHttp.Post(Url,RequestStream,ResponseStream); except on e : Exception do begin ShowMessage(e.Message); end; end; //获取网页返回的信息 ResponseStr := ResponseStream.DataString; //网页中的存在中文时,需要进行UTF8解码 ResponseStr := UTF8Decode(ResponseStr); finally IdHttp.Free; RequestList.Free; RequestStream.Free; ResponseStream.Free; end; //s:=ResponseStr; //s:=list1.Text; s2:='kjhm="'+copy(DateTimeToStr(Date()),3,2)+copy(DateTimeToStr(Date()),6,2)+copy(DateTimeToStr(Date()),9,2); StringGridView1.Columns[0,0].Title:='开奖日期'; StringGridView1.Columns[1,0].Title:='奖号'; StringGridView1.Columns[0,0].Width:=80; StringGridView1.Columns[1,0].Width:=50;
for I :=Low(ResponseStr) to high(ResponseStr) do begin
//if copy(ResponseStr,i+1,12)=s2 then //begin // s3:=s3+copy(ResponseStr,i+7,9); //s4:=s4+copy(ResponseStr,i+18,5);
if ResponseStr.Substring(i+1,12)=s2 then begin s3:=s3+ResponseStr.Substring(i+7,9); s4:=s4+ResponseStr.Substring(i+18,5); end else begin continue; end;
end; self.StringGridView1.RowCount:=length(s4) div 5; //self.Label1.Text:=s4; for j:=1 to length(s4) div 5 do begin StringGridView1.Cells[0,j-1]:=copy(s3,j*9-8,9); StringGridView1.Cells[1,j-1]:=copy(s4,j*5-4,5); end;