以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- [分享]难记住的随机密码(包含数字、大小写字母、特殊字符) (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=180274) |
-- 作者:洮沙 -- 发布时间:2022/10/11 18:03:00 -- [分享]难记住的随机密码(包含数字、大小写字母、特殊字符) Dim n As Integer = 12 \'要生成密码长度 Dim str() As String = {"1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "~", "!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "_", "-", "=", "+", ";", ":", "\'", "[", "]", ",", ".", "/", "<", ">", "?", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S" , "T", "U", "V", "W", "X", "Y", "Z"} For i As Integer = 1 To str.Length \'洗牌测次数 Dim n1 As Integer = Rand.Next(str.Length) Dim n2 As Integer = Rand.Next(str.Length) Dim temp As String = str(n1) str(n1) = str(n2) str(n2) = temp Next Dim s As String = String.Join("", str) If n > s.Length Then n = s.Length End If Output.Show(s.Substring(0, n)) 运行结果: M764w1%\'03+X
[此贴子已经被作者于2022/10/11 18:05:45编辑过]
|
-- 作者:wlj88868 -- 发布时间:2024/4/11 9:24:00 -- 2维码列里面直接生成可以用吗,需要怎么调整一下啊 2维码列里面直接生成可以用吗,需要怎么调整一下啊 |