function RandomStr(Digit:Integer):string; var i: integer; s: string; begin s := 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; setLength(Result,Digit); Randomize; for i := 1 to Digit do //循环次数也就是字节数
begin Result[I] := s[Random(Length(s)-1)+1]; end; end;