如何利用C#产生随机密码字符串
相关代码如下:
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
搜索更多相关主题的帖子:
密码 字符 随机