Rss & SiteMap

Foxtable(狐表) http://www.foxtable.com

新一代数据库软件,完美融合Access、Foxpro、Excel、vb.net之优势,人人都能掌握的快速软件开发工具!
共4 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:生成随机字符串

1楼
cd_tdh 发表于:2024/4/2 12:28:00
老师,随机生成一个108位的含数字和<>+-*/ 的字符串怎么生成?


[此贴子已经被作者于2024/4/2 13:13:18编辑过]
2楼
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)
3楼
cd_tdh 发表于:2024/4/2 13:23:00
谢谢,能不能限定第一个字符不能是特殊字符呢
4楼
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)
共4 条记录, 每页显示 10 条, 页签: [1]

Copyright © 2000 - 2018 foxtable.com Tel: 4000-810-820 粤ICP备11091905号

Powered By Dvbbs Version 8.3.0
Processed in .02344 s, 2 queries.