本文整理自网络,侵删。
function ParamsEncode(const ASrc: Ansistring): AnsiString;var i: Integer;begin Result := ''; for i := 1 to Length(ASrc) do begin if (ASrc[i] in ['&', '*','#','%','<','>',' ','[',']']) or (not (ASrc[i] in [#33..#128])) then begin Result := Result + '%' + IntToHex(Ord(ASrc[i]), 2); end else begin Result := Result + ASrc[i]; end; end;end;
相关阅读 >>
更多相关阅读请进入《Delphi》频道 >>