const BUF_SIZE = 20480; //$7FFF; var Buf: array[0..BUF_SIZE] of Char; BufCount, Count, SrcLen, i, ArrCount: LongInt; Ch: Char; label CATCH_DIV; begin Ch := #0; //Jacky try SrcLen := Length(Str); BufCount := 0; Count := 1;
if SrcLen >= BUF_SIZE - 1 then begin Result := '; Dest := '; Exit; end;
if Str = ' then begin Dest := '; Result := Str; Exit; end; ArrCount := SizeOf(Divider) div SizeOf(Char);
while True do begin if Count <= SrcLen then begin Ch := Str[Count]; for i := 0 to ArrCount - 1 do if Ch = Divider[i] then goto CATCH_DIV; end; if (Count > SrcLen) then begin CATCH_DIV: if (BufCount > 0) then begin if BufCount < BUF_SIZE - 1 then begin Buf[BufCount] := #0; Dest := string(Buf); Result := Copy(Str, Count + 1, SrcLen - Count); end; break; end else begin if (Count > SrcLen) then begin Dest := '; Result := Copy(Str, Count + 2, SrcLen - 1); break; end; end; end else begin if BufCount < BUF_SIZE - 1 then begin Buf[BufCount] := Ch; Inc(BufCount); end; // else //ShowMessage ('BUF_SIZE overflow !'); end; Inc(Count); 试了一下登陆QQ,用的httpget,可以正常登陆,试过idhttp,但就是不成功.得不到COOKIE,哪位高手帮忙一下.如果用IDHTTP搞好了发个出来,谢谢,