[Tutorial] Fake Email Generator

Posts 1–6 of 6 · Page 1 of 1
[Tutorial] Fake Email Generator
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
Quote Originally Posted by Marthz View Post
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

First give credit where it is do, Pradeep1210 , Negative0 gave you that code over there on (unmentioned forum).

After you give credit to everyone who gave you that code, Ill say "good job on sharing what you have learned"

Edit: Thanks, I'm personally big on giving credit where it is do, thanks for sharing, you have been thanked
Quote Originally Posted by NextGen1 View Post
First give credit where it is do, Pradeep1210 , Negative0 gave you that code over there on (unmentioned forum).

After you give credit to everyone who gave you that code, Ill say "good job on sharing what you have learned"

Edit: Thanks, I'm personally big on giving credit where it is do, thanks for sharing, you have been thanked
I'm surprised you know that. Pradeep really didn't help all he did was put a & that's all. I don't seem why you would get into all of that anyways.
Quote Originally Posted by Marthz View Post
I'm surprised you know that. Pradeep really didn't help all he did was put a & that's all. I don't seem why you would get into all of that anyways.
Always give credit, leechers get no credit here at all, so give credit if it's not yours, simple really, anyone of us VB guys (or even the C guys who come over to say hi every now and then) would say something about giving credit.

I just got here first
Crap on

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
Change it to

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("\emails.txt", myString) ' Saves all the text from textbox to it
Posts 1–6 of 6 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us