I'm making a simple keygen in VB2010 (random keys, with no program or game objective) and i got a problem.
It have two Tabs, both have a TextBox and two buttons: Generate and Save Keys. The first tab is a Single Key generator, a non-multiline textbox, and the second should generate 1000 keys, one key per line. The problem is that i don't know how to set the 1000 keys number. With a list it would be easy:
Dim a As String
While ListBox1.Items.Count < 1000
code
End While
End Sub
But i tryed this for the TextBox:
Dim a As String
TextBox2.Text.Count(1000)
code
End Sub
But it gives me this error:
A type 'Integer' value can't convert into 'System.Func(OfChar, Boolean)'.
How the f*ck can i set 1k keys per line in a TextBox??
Download the code here (Frame Banner Adly + Mediafire) or read it here:
Updateeee
Fck, i've tryed a While Count of 1000, 500, 2 or any number but when i click generate it freezes. Daaamn..
Hope some pro coders help me
My head is blowing up. Someone can help me? I just want to add X key number at the same time in a TextBox!!
It have two Tabs, both have a TextBox and two buttons: Generate and Save Keys. The first tab is a Single Key generator, a non-multiline textbox, and the second should generate 1000 keys, one key per line. The problem is that i don't know how to set the 1000 keys number. With a list it would be easy:
Dim a As String
While ListBox1.Items.Count < 1000
code
End While
End Sub
But i tryed this for the TextBox:
Dim a As String
TextBox2.Text.Count(1000)
code
End Sub
But it gives me this error:
A type 'Integer' value can't convert into 'System.Func(OfChar, Boolean)'.
How the f*ck can i set 1k keys per line in a TextBox??
Download the code here (Frame Banner Adly + Mediafire) or read it here:
Public Class Form1
'!KeyGen coding!'
'Single KeyGen'
Public Function makepw1() As Object
Dim E, F, G, H, J As Object
E = "1234567890ABCDEFGHIJKLMNOPQRSTUVWXZ"
F = Len(E)
G = 25
Randomize()
H = ""
For intstep = 1 To G
J = Int((F * Rnd()) + 1)
H = H & Mid(E, J, 1)
Next
makepw1 = H
End Function
Public Function makepw2() As Object
Dim E, F, G, H, J As Object
E = "1234567890ABCDEFGHIJKLMNOPQRSTUVWXZ"
F = Len(E)
G = 25
Randomize()
H = ""
For intstep = 1 To G
J = Int((F * Rnd()) + 1)
H = H & Mid(E, J, 1)
Next
makepw2 = H
End Function
'!First TabControl menu //Single Key//!'
'Generate SingleKey button'
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim a As String
a = makepw1()
TextBox1.Text = a
End Sub
'--Generated SingleKey TextBox'
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
End Sub
'--Save SingleKey button'
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim Save As New SaveFileDialog()
Dim myStreamWriter As System.IO.StreamWriter
Save.Filter = "Text (*.txt)|*.txt"
Save.CheckPathExists = True
Save.Title = "Save Key As"
Save.ShowDialog(Me)
Try
myStreamWriter = System.IO.File.AppendText(Save.FileName)
myStreamWriter.Write(TextBox1.Text)
myStreamWriter.Flush()
Catch ex As Exception
End Try
End Sub
'!Second TabContol menu //Multiple Keys//!'
'--Generate MultipleKeys button'
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim a As String
TextBox2.Text.Count(1000)
a = makepw2()
TextBox2.Text = a
End Sub
'--Save MultipleKeys button'
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Dim Save As New SaveFileDialog()
Dim myStreamWriter As System.IO.StreamWriter
Save.Filter = "Text (*.txt)|*.txt"
Save.CheckPathExists = True
Save.Title = "Save Keys As"
Save.ShowDialog(Me)
Try
myStreamWriter = System.IO.File.AppendText(Save.FileName)
myStreamWriter.Write(TextBox2.Text)
myStreamWriter.Flush()
Catch ex As Exception
End Try
End Sub
Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
End Sub
End Class
'!KeyGen coding!'
'Single KeyGen'
Public Function makepw1() As Object
Dim E, F, G, H, J As Object
E = "1234567890ABCDEFGHIJKLMNOPQRSTUVWXZ"
F = Len(E)
G = 25
Randomize()
H = ""
For intstep = 1 To G
J = Int((F * Rnd()) + 1)
H = H & Mid(E, J, 1)
Next
makepw1 = H
End Function
Public Function makepw2() As Object
Dim E, F, G, H, J As Object
E = "1234567890ABCDEFGHIJKLMNOPQRSTUVWXZ"
F = Len(E)
G = 25
Randomize()
H = ""
For intstep = 1 To G
J = Int((F * Rnd()) + 1)
H = H & Mid(E, J, 1)
Next
makepw2 = H
End Function
'!First TabControl menu //Single Key//!'
'Generate SingleKey button'
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim a As String
a = makepw1()
TextBox1.Text = a
End Sub
'--Generated SingleKey TextBox'
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
End Sub
'--Save SingleKey button'
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim Save As New SaveFileDialog()
Dim myStreamWriter As System.IO.StreamWriter
Save.Filter = "Text (*.txt)|*.txt"
Save.CheckPathExists = True
Save.Title = "Save Key As"
Save.ShowDialog(Me)
Try
myStreamWriter = System.IO.File.AppendText(Save.FileName)
myStreamWriter.Write(TextBox1.Text)
myStreamWriter.Flush()
Catch ex As Exception
End Try
End Sub
'!Second TabContol menu //Multiple Keys//!'
'--Generate MultipleKeys button'
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim a As String
TextBox2.Text.Count(1000)
a = makepw2()
TextBox2.Text = a
End Sub
'--Save MultipleKeys button'
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Dim Save As New SaveFileDialog()
Dim myStreamWriter As System.IO.StreamWriter
Save.Filter = "Text (*.txt)|*.txt"
Save.CheckPathExists = True
Save.Title = "Save Keys As"
Save.ShowDialog(Me)
Try
myStreamWriter = System.IO.File.AppendText(Save.FileName)
myStreamWriter.Write(TextBox2.Text)
myStreamWriter.Flush()
Catch ex As Exception
End Try
End Sub
Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
End Sub
End Class
Updateeee
Fck, i've tryed a While Count of 1000, 500, 2 or any number but when i click generate it freezes. Daaamn..
Hope some pro coders help me

My head is blowing up. Someone can help me? I just want to add X key number at the same time in a TextBox!!