zoukankan
html css js c++ java
创建随机字符串
1
/**/
///
<summary>
2
///
创建随机字符串
3
///
</summary>
4
///
<param name="codeCount">
随机数的位数
</param>
5
///
<returns></returns>
6
public
static
string
CreateRandomCode_Len54(
int
codeCount)
7
{
8
string
allChar
=
"
1,A,2,S,3,D,4,F,5,G,6,H,7,J,8,K,9,L,8,M,7,N,6,B,5,V,4,C,3,X,2,Z,1,P,9,Q,8,Z,7,W,6,I,5,E,4,U,3,R,2,Y,1,T,E,X,G,Q
"
;
9
string
[] allCharArray
=
allChar.Split(
'
,
'
);
10
string
randomCode
=
""
;
11
int
temp
=
-
1
;
12
13
Random rand
=
new
Random();
14
for
(
int
i
=
0
; i
<
codeCount; i
++
)
15
{
16
if
(temp
!=
-
1
)
17
{
18
rand
=
new
Random(i
*
temp
*
((
int
)DateTime.Now.Ticks));
19
}
20
int
t
=
rand.Next(
54
);
21
if
(temp
==
t)
22
{
23
return
CreateRandomCode_Len54(codeCount);
24
}
25
temp
=
t;
26
randomCode
+=
allCharArray[t];
27
}
28
return
randomCode;
29
}
查看全文
相关阅读:
JSON 体验JSON (二)json格式化日期
让D2006的控件面板回到D7的样式
突破网站限制 复制网页内容
欢迎光临
加密Access数据库
取得程序中一些特殊文件夹的位置
连接带密码的Access数据库
我被强暴,老公这样回答是人么?(转~非黄)
【WinCE版凯立德】2012春季版地图下载
刚刚拍到的日环食金星凌日
原文地址:https://www.cnblogs.com/ghd258/p/270438.html
最新文章
[bbk4982]第09集 Chapter 05 Writing Control Structures(01)
[bbk4984]第10集 Chapter 05 Writing Control Structures(02)
[bbk5300]第17集 Chapter 08 Handling Exceptions(00)
[LAMP兄弟连李明老师讲Linux].30_第10讲.shell编程(上)
[bbk5364]第19集 Chapter 08 Handling Exceptions(02)
PL/SQL高级Overview
ECSHOP 助手使用
selenium 无界面跑UI脚本
git乌龟http/https以及ssh clone的秘钥配置永久免密码登录设置
Selenium 设置代理chrome
热门文章
gitblit server windows搭建
python 多版本共存
git 代码分支合并merge提交新修改远程以及本地分支
unittest框架官方翻译:中文版
jenkins持续集成python cases
python HtmlTestRunner python2.x python3.x报告优化模板源码下载
git 代码比较工具,分支冲突解决
Group Codes in Numerical Order(zz.IS2120@BG57IV3)
DbMon.c (zz)
Predefined Keyboard Shortcuts (zz.IS2120@BG57IV3.T717662197)
Copyright © 2011-2022 走看看