关于超想
本站导航
邮件列表
  首页 | 本站产品 | Delphi资料 | 免费资源 | 程序人生 | 软件工程 | 网站设计 | 推荐网站
你所在的位置 -> 主页 -> 超想软件 -> 编程资料 -> delphi -> 开发技巧 -> 数值算法 ->详细
相关内容  
 
 
 
【新品推荐】

  详细内容
 

产生随机密码
作者: 评价: 上站日期: 2001-05-05
内容说明:
来源:

function TfrmPWGenerate.btnGenerateClick(Sender: TObject): string;

{max length of generated password}
const
  intMAX_PW_LEN = 10;
var
  i: Byte;
  s: string;
begin
  {if you want to use the 'A..Z' characters}
  if cbAZ.Checked then
    s := 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
  else
    s := '';

  {if you want to use the 'a..z' characters}
  if cbAZSmall.Checked then
    s := s + 'abcdefghijklmnopqrstuvwxyz';

  {if you want to use the '0..9' characters}
  if cb09.Checked then
    s := s + '0123456789';
  if s = '' then exit;

  Result := '';
  for i := 0 to intMAX_PW_LEN-1 do
    Result := Result + s[Random(Length(s)-1)+1];
end;

initialization
  Randomize;

运行结果:
IBbfA1mVK2
tmuXIuQJV5
oNEY1cF6xB
flIUhfdIui
mxaK71dJaq
B0YTqxdaLh
...

 
你所在的位置 -> 主页 -> 超想软件 -> 编程资料 -> delphi -> 开发技巧 -> 数值算法 ->详细
  首页 | 本站产品 | Delphi资料 | 免费资源 | 程序人生 | 软件工程 | 网站设计 | 推荐网站
声明:本站内容除注明原创以外均从网上摘抄,如有侵权请指明。
  如果您对我们的网站有什么意见或者建议,请与我们联系
powered by 建站易上手- V2.0