如何利用c产生随机密码字符串
·木马病毒如何利用文件关联和设置名感染
·如何利用html格式化你的硬盘
·如何利用局域网来实现vlan的实例
·开发应用时如何利用c#自定义属性
·windows xp 中如何利用sysprep工具审核安
·如何利用1.10版赚钱或者破产
·如何利用路由器防止dos攻击
·如何利用sql 注入遍历目录
·如何利用apache+tomcat配置jsp开发环境?
相关代码如下:
using system;
using system.security.cryptography;
using system.text;
namespace utility {
public class passwordgenerator {
public passwordgenerator() {
this.minimum = defaultminimum;
this.maximum = defaultmaximum;
this.consecutivecharacters = false;
this.repeatcharacters = true;
this.excludesymbols = false;
this.exclusions = null;
rng = new rngcryptoserviceprovider();
}
protected int getcryptographicrandomnumber(int lbound, int ubound) {
// 假定 lbound >= 0 && lbound < ubound
// 返回一个 int >= lbound and < ubound
uint urndnum;
byte;
if (lbound == ubound-1) {
// 只有ibound返回的情况
return lbound;
}
uint xcluderndbase = (uint.maxvalue - (uint.maxvalue%(uint)(ubound-lbound)));
do {
rng.getbytes(rndnum);
urndnum = system.bitconverter.touint32(rndnum,0);
} while (urndnum >= xcluderndbase);
return (int)(urndnum % (ubound-lbound)) + lbound
-
相关文章
2秒记住本站域名
玩过泡泡龙吗?Readygo?Go! 再加上.Com.Cn的后缀,那就是大名小顶的ReadyGo.com.cn
