Ok first add a 2 Buttons, and a Textbox.
This will make 1000 fake emails.
Button1 - Generate
Button2 - Save
Textbox1 - Holds Emails
Also add a Textfile Resource named words,, Put a random word list in the word resource file. They have to be all on a new string like this though.
Word1
Word2
Word3
You can find word lists everywhere so it wont be a problem.
Source ~
Code:
Public Class Form1
Private words() As String
Private Names() As String = {"@hotmail.com", "@yahoo.com", "@gmail.com"}
Private RandGen As Random
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
RandGen = New Random()
Dim tmp As String = My.Resources.words.Replace(vbCrLf, ";")
Dim words() As String = tmp.Split(";"c)
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim s As String
For i = 0 To 999
s = words(RandGen.Next(0, words.Length)) ' Get a random word from the word list read from the file
s &= RandGen.Next(1000, 10000).ToString() ' Get a random number between 1000 and 9999
s &= Names(RandGen.Next(0, Names.Length)) ' Get a random name from the list of names
TextBox1.AppendText(s & Environment.NewLine)
Next
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim myString As String = TextBox1.Text
Dim file As System.IO.FileStream
file = System.IO.File.Create("\emails.txt")
IO.File.WriteAllText("\field.txt", myString)
End Sub
End Class
Ok now.
Code:
Private words() As String ' The words that it will use
Private Names() As String = {"@hotmail.com", "@yahoo.com", "@gmail.com"} ' The ending
Private RandGen As Random ' The numbers to be added after the word
Next,
Code:
RandGen = New Random()
Dim tmp As String = My.Resources.words.Replace(vbCrLf, ";") ' Loads the word resource
Dim words() As String = tmp.Split(";"c) ' Same here
Next,
Code:
Dim s As String
For i = 0 To 999
s = words(RandGen.Next(0, words.Length)) ' Get a random word from the word list read from the file
s &= RandGen.Next(1000, 10000).ToString() ' Get a random number between 1000 and 9999
s &= Names(RandGen.Next(0, Names.Length)) ' Get a random name from the list of names
TextBox1.AppendText(s & Environment.NewLine) ' Appends the text to the next box and everytime on a new line
Next
Next,
Code:
Dim myString As String = TextBox1.Text
Dim file As System.IO.FileStream
file = System.IO.File.Create("\emails.txt") ' Creates the email file
IO.File.WriteAllText("\field.txt", myString) ' Saves all the text from textbox to it
CREDITS:Negative0