本文整理自网络,侵删。
Delphi X秒生成大量垃圾字符
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;
相关阅读 >>
Delphi application.processmessages的作用
Delphi中操作olevariant、variant和stream
更多相关阅读请进入《Delphi》频道 >>