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 的编码与解码(或叫加密与解密)函数

Delphi 间隔时间

Delphi编程用流来读取txt文件中的数据

Delphi 同时激活两个窗体

Delphi xe5 android在桌面添加快捷方式

Delphi 简单的日志记录

Delphi从dbgrid导出数据保存成excel文件

Delphi 提高unigui开发效率的两个方法

Delphi 中文姓名 合法性检查

Delphi 屏蔽特殊字符

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



打赏

取消

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

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

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

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

评论

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