以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 生成随机字符串 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=191219) |
-- 作者:cd_tdh -- 发布时间:2024/4/2 12:28:00 -- 生成随机字符串 老师,随机生成一个108位的含数字和<>+-*/ 的字符串怎么生成? [此贴子已经被作者于2024/4/2 13:13:18编辑过]
|
-- 作者:pyh6918 -- 发布时间:2024/4/2 13:13:00 -- Dim s As String = "0123456789<>+-*/" Dim zf108 As String = "" Dim Val3 As Integer For i As Integer = 1 To 108 Val3 = Rand.Next(0,15) zf108 = zf108 & s.Chars(val3) Next Output.Show(zf108)
|
-- 作者:cd_tdh -- 发布时间:2024/4/2 13:23:00 -- 谢谢,能不能限定第一个字符不能是特殊字符呢 |
-- 作者:pyh6918 -- 发布时间:2024/4/2 13:29:00 -- Dim s As String = "0123456789<>+-*/" Dim zf108 As String = Rand.Next(0,9) Dim Val3 As Integer For i As Integer = 1 To 107 Val3 = Rand.Next(0,15) zf108 = zf108 & s.Chars(val3) Next Output.Show(zf108)
|