H租号网:您身边最放心的安全下载站! 最新软件|热门排行|软件分类|软件专题|论坛转帖|厂商大全

您的位置: 首页 > 低价租号
租号密码生成器

租号密码生成器

卡号密码生成器 确定按钮代码

窗体上添加两个textbox,在text1中显示卡号、密码,以空格分开

text2输入要生成多少组号码,command1生成,command2保存文件,代码如下,

参考!

------------------------------------------------------------

Option Explicit

Private Sub Command1_Click()

Static n As Integer

Dim x As Integer, m As Integer

Dim i As Integer, j As Integer

Dim chrRnd As String

Dim chrSpc As String

Dim chrKa As String, chrMima As String

m = Val(Text2)

For j = 1 To m

chrRnd = "": chrKa = "": chrMima = "": chrSpc = ""

n = n + 1

Randomize

For i = 0 To 9

chrRnd = chrRnd & Int(Rnd * 10) '生成10位随机码

Next

For i = 1 To 5

flag1:

x = Int(Rnd * 75) + 48

If x > 57 And x < 97 Then GoTo flag1 '生成特殊码

chrSpc = chrSpc & Chr(x)

Next

chrKa = chrKa & chrRnd & chrSpc & Format(n, "000000") '空格分开,这里也可不要空格,根据你的需要

chrSpc = ""

For i = 1 To 20

flag2:

x = Int(Rnd * 75) + 48

If x > 57 And x < 97 Then GoTo flag2 '生成名称

chrSpc = chrSpc & Chr(x)

Next

chrMima = chrMima & chrSpc & Format(n, "000000")

Text1 = Text1 & chrKa & " " & chrMima & vbCrLf

Next

End Sub

Private Sub Command2_Click()

Open "d:\卡号密码.txt" For Output As #1 '保存文件

Print Text1.Text

Close #1

End Sub

Private Sub Form_Load()

Dim item As Control

For Each item In Me

If TypeOf item Is TextBox Then item.Text = ""

Next

End Sub

'随机生成N个数字(通用过程,请放在声明部分)

Function GetRnd(zfc As String, RndLen As Integer) As String

Dim i As Long, ZfcLen As Integer, S As String

ZfcLen = Len(zfc)

Randomize Timer

For i = 1 To ZfcLen

S = S & Mid(zfc, Rnd * (ZfcLen - 1) + 1, 1)

If Len(S) = RndLen Then Exit For

Next

GetRnd = S

End Function

Private Sub Command1_Click() '确定按钮

Dim Num1 As String, Num2 As String

Dim i As Long, Kh As String, Mm As String

'产生要获取的密码表

For i = 48 To 57

Num1 = Num1 & Chr(i)

Next

For i = 65 To 90

Num2 = Num2 & Chr(i)

Next

For i = 97 To 122

Num2 = Num2 & Chr(i)

Next

For i = 1 To Val(Text5.Text)

'名称代码+10位由0到9组成的随机码+特殊码+顺序编号 "卡号为20位<<注意:此处实际长度为26位,而你说是20位有矛盾,请自行修改>>

Kh = Kh & Text3.Text & GetRnd(Num1, 10) & Text4.Text & Format(i, "000000") & vbNewLine

'生成名称+特殊码+10位由26个字母和0到9组成的随机码+顺序编号 "密码为26位

Mm = Mm & Text3.Text & Text4.Text & GetRnd(Num1 & Num2, 10) & Format(i, "000000") & vbNewLine

Next

Text1.Text = Kh

Text2.Text = Mm

End Sub

要一个密码批量生成器,要密码最后几位可以设置为如zzzzz的 高分

试试《文件批量处理百宝箱V8.0》拓展界面中的批量随机数功能吧。选择随机数的类型和位数,然后勾选附加在后并在其后面输入待附加的内容比如zzzzz,最后单击“产生”,得到的密码随机数保存在一个txt文件中以备用。

下载地址:http://www.crsky.com/soft/26800.html

卡号密码生成器主问题贴

你这个text太多了,没啥用,2个够了!

窗体上添加两个textbox,在text1中显示卡号、密码,以空格分开

text2输入要生成多少组号码,command1生成,command2保存文件,代码如下,看看行不行,再修改!

------------------------------------------------------------

Option Explicit

Private Sub Command1_Click()

Static n As Integer

Dim x As Integer, m As Integer

Dim i As Integer, j As Integer

Dim chrRnd As String

Dim chrSpc As String

Dim chrKa As String, chrMima As String

m = Val(Text2)

For j = 1 To m

chrRnd = "": chrKa = "": chrMima = "": chrSpc = ""

n = n + 1

Randomize

For i = 0 To 9

chrRnd = chrRnd & Int(Rnd * 10) '生成10位随机码

Next

For i = 1 To 5

flag1:

x = Int(Rnd * 75) + 48

If x > 57 And x < 97 Then GoTo flag1 '生成特殊码

chrSpc = chrSpc & Chr(x)

Next

chrKa = chrKa & chrRnd & chrSpc & Format(n, "000000") '空格分开,这里也可不要空格,根据你的需要

chrSpc = ""

For i = 1 To 20

flag2:

x = Int(Rnd * 75) + 48

If x > 57 And x < 97 Then GoTo flag2 '生成名称

chrSpc = chrSpc & Chr(x)

Next

chrMima = chrMima & chrSpc & Format(n, "000000")

Text1 = Text1 & chrKa & " " & chrMima & vbCrLf

doevents

Next

End Sub

Private Sub Command2_Click()

Open "d:\卡号密码.txt" For Output As #1 '保存文件

Print Text1.Text

Close #1

End Sub

Private Sub Form_Load()

Dim item As Control

For Each item In Me

If TypeOf item Is TextBox Then item.Text = ""

Next

End Sub

注:编号的问题,如果下次在启动程序编号还是从1开始,这个我不会弄,所以你要一次生成足够的号码!

名称代码+10位由0到9组成的随机码+特殊码+顺序编号

=5+10+5+6

=26

你说的卡号为20位与上述具体要求不符呀。

********************************************************

下面是保存按钮的代码:

Private Sub Command2_Click()

Dim Fn As Integer, i As Integer

Dim FileName As String, a() As String, b() As String

a = Split(Text1.Text, vbNewLine)

b = Split(Text2.Text, vbNewLine)

FileName = App.Path & "\卡密.txt"

Fn = FreeFile

Open FileName For Output As #Fn

For i = 0 To UBound(a)

Print #Fn, a(i) & " " & b(i)

Next

Close #Fn

MsgBox "文件<卡密.txt>保存完毕!", vbInformation, "恭喜你"

End Sub

'其他代码部分(Text1_Change与Text2_Change没必要增加代码,所以略去)

Private Sub Text3_Change()

Dim i As Integer, S As String

For i = 1 To Len(Text3.Text)

S = Mid(Text3.Text, i, 1)

If Not (S >= "0" And S <= "9" Or S >= "a" And S <= "z" Or S >= "A" And S <= "Z") Then

MsgBox "请输入数字或字母!", vbCritical, "出错提示"

Text3.SetFocus

End If

Next

If Len(Text3.Text) > 5 Then

MsgBox "输入数字或字母只能是5位!", vbCritical, "出错提示"

Text3.SetFocus

End If

End Sub

Private Sub Text4_Change()

Dim i As Integer, S As String

For i = 1 To Len(Text4.Text)

S = Mid(Text4.Text, i, 1)

If Not (S >= "0" And S <= "9" Or S >= "a" And S <= "z" Or S >= "A" And S <= "Z") Then

MsgBox "请输入数字或字母!", vbCritical, "出错提示"

Text3.SetFocus

End If

Next

If Len(Text4.Text) > 5 Then

MsgBox "输入数字或字母只能是5位!", vbCritical, "出错提示"

Text3.SetFocus

End If

End Sub

Private Sub Text5_Change()

If Not IsNumeric(Text5.Text) Then

MsgBox "请输入数字!", vbCritical, "出错提示"

Text5.SetFocus

End If

End Sub

Private Sub Command1_Click()

'名称代码+10位由0到9组成的随机码+特殊码+顺序编号 "卡号为20位 并生成名称+特殊码+10位由26个字母和0到9组成的随机码+顺序编号 "密码为26位

'顺序编号是一个1-10000之间的数并且从1开始每个递增

End Sub

要达到这个要求!

顺序编号应该是一个6位数!1-100000之间的6位数!

且不足6位时,1表示为000001

100表示为:000100

类推才对!

电脑

安卓

苹果

网友评论

热门评论

最新评论

发表评论 查看所有评论(0)

昵称:
请不要评论无意义或脏话,我们所有评论会有人工审核.
字数: 0/500 (您的评论需要经过审核才能显示)