delphi 随机程序名


本文整理自网络,侵删。

 

Function Randstring():string;
var
i,t,n:Integer;
c,s:string;
begin
repeat
randomize();
n:=Random(16);
until (n>=6) and (n<=16) ;
for i:=0 to n do
begin
if i=0 then t:=Random(25)+10 else t:=Random(35);
case t of
0 :c:='0';
1 :c:='1';
2 :c:='2';
3 :c:='3';
4 :c:='4';
5 :c:='5';
6 :c:='6';
7 :c:='7';
8 :c:='8';
9 :c:='9';
10:c:='a';
11:c:='b';
12:c:='c';
13:c:='d';
14:c:='e';
15:c:='f';
16:c:='g';
17:c:='h';
18:c:='i';
19:c:='j';
20:c:='k';
21:c:='l';
22:c:='m';
23:c:='n';
24:c:='o';
25:c:='p';
26:c:='q';
27:c:='r';
28:c:='s';
29:c:='t';
30:c:='u';
31:c:='v';
32:c:='w';
33:c:='x';
34:c:='y';
35:c:='z';
end;
s:=s+c;
end;
Result:=s;
end;


procedure TForm1.FormCreate(Sender: TObject);
begin
form1.Caption:=Randstring();
end;

相关阅读 >>

Delphi开发linux包

Delphi版inf方式加载驱动

Delphi 附加数据读取

Delphi判断字符串是否为数字

Delphi tstringlist的delimitedtext的空格问题

Delphi 获得memo、richedit的光标位置

减小Delphi xe5编译出来的程序体积

Delphi 取得固定长度的随机字符串

Delphi 全局的鼠标钩子 使用钩子函数数据传递

Delphi 7 简单语法

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...

    正在狠努力加载,请稍候...