产生指定长度的随机字符串

//如需包含小写字母,数字,在S中添加。 
function aaa(Num:Integer): string;
var
i: Byte;
s:
string;
begin
s :
= 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
Result :
= '';
for i := 0 to Num-1 do
Result :
= Result + s[Random(Length(s)-1)+1];
end;

posted on 2008-11-27 13:15  jxgxy  阅读(520)  评论(0编辑  收藏  举报

导航