Search
Latest topics
Who is online?
In total there are 5 users online :: 0 Registered, 0 Hidden and 5 Guests None
Most users ever online was 38 on Sun Mar 19, 2023 10:07 pm
Most Viewed Topics
Email Spammer
3 posters
Page 1 of 1
Email Spammer
Code:
Private Sub GhostButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GhostButton2.Click
BackgroundWorker1.CancelAsync()
End Sub
Private Sub clear()
Label12.Visible = False
Label13.Visible = False
Label14.Visible = False
Label15.Visible = False
Label16.Visible = False
GhostTextBox6.ReadOnly = True
GhostTextBox7.ReadOnly = True
End Sub
Private Sub GhostButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GhostButton1.Click
Select Case String.Empty
Case GhostTextBox1.Text
Label12.Visible = True
Case GhostTextBox2.Text
Label13.Visible = True
Case GhostTextBox5.Text
Label14.Visible = True
Case GhostTextBox6.Text, GhostTextBox7.Text
Label15.Visible = True
Label16.Visible = True
MessageBox.Show("Please choose your Mail Provider", "Mail Provider Not Chosen", MessageBoxButtons.OK, MessageBoxIcon.Error)
Case Else
clear()
s1 = 0
ProgressBar1.Value = 0
ProgressBar1.Update()
GhostButton1.Enabled = False
GhostButton3.Enabled = False
GhostButton2.Enabled = True
If NumericUpDown1.Value = 0 Then
MessageBox.Show("Please select how many mails do you want to sent!", "How many mail to be sent ?", MessageBoxButtons.OK, MessageBoxIcon.Error)
Else
BackgroundWorker1.RunWorkerAsync()
ProgressBar1.Maximum = NumericUpDown1.Value
ProgressBar1.Value = 0
End If
End Select
End Sub
Private Sub BackgroundWorker1_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork
Try
Dim msg As New MailMessage()
msg.From = New MailAddress(GhostTextBox1.Text)
msg.To.Add(GhostTextBox5.Text)
msg.Subject = (GhostTextBox4.Text)
msg.Body = GhostTextBox3.Text
For counter = 0 To ListBox1.Items.Count - 1
Dim Attach As Net.Mail.Attachment = New Net.Mail.Attachment(ListBox1.Items(counter))
msg.Attachments.Add(Attach)
Next
Dim SMTPServer As New SmtpClient
SMTPServer.Host = GhostTextBox6.Text
SMTPServer.Port = GhostTextBox7.Text
SMTPServer.Credentials = New System.Net.NetworkCredential(GhostTextBox1.Text, GhostTextBox2.Text)
SMTPServer.EnableSsl = True
Do Until s1 = NumericUpDown1.Value
If BackgroundWorker1.CancellationPending Then
Exit Sub
End If
SMTPServer.Send(msg)
s1 = s1 + 1
Me.ProgressBar1.Value = s1
Loop
MessageBox.Show("All the Mail has been Sent!", "Mail Sent", MessageBoxButtons.OK, MessageBoxIcon.Information)
ProgressBar1.Value = 0
Catch ex As Exception
MessageBox.Show(ex.ToString)
End Try
End Sub
Private Sub OpenFileDialog1_FileOk(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles OpenFileDialog1.FileOk
For Each fls As String In OpenFileDialog1.FileNames
ListBox1.Items.Add(fls)
Next
End Sub
Private Sub GhostButton4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GhostButton4.Click
OpenFileDialog1.ShowDialog()
End Sub
Private Sub donework(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BackgroundWorker1.RunWorkerCompleted
GhostButton1.Enabled = True
GhostButton3.Enabled = True
GhostButton2.Enabled = False
End Sub
Private Sub GhostButton5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GhostButton5.Click
If ListBox1.Items.Count = 0 Then
MessageBox.Show("No attachments to clear", "No Attachments", MessageBoxButtons.OK, MessageBoxIcon.Error)
Else
ListBox1.Items.Clear()
End If
End Sub
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
Select Case ComboBox1.SelectedIndex
Case 1
GhostTextBox6.ReadOnly = False
GhostTextBox7.ReadOnly = False
Case 2
GhostTextBox6.Text = "smtp.gmail.com"
GhostTextBox7.Text = "587"
Case 3
GhostTextBox6.Text = "smtp.mail.yahoo.com"
GhostTextBox7.Text = "465"
Case 4
GhostTextBox6.Text = "smtp.live.com"
GhostTextBox7.Text = "587"
Case 5
GhostTextBox6.Text = "smtp.aol.com"
GhostTextBox7.Text = "587"
End Select
End Sub
End Class
[You must be registered and logged in to see this link.]
Note:
Both both x64 and x86 exe are there the links
Private Sub GhostButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GhostButton2.Click
BackgroundWorker1.CancelAsync()
End Sub
Private Sub clear()
Label12.Visible = False
Label13.Visible = False
Label14.Visible = False
Label15.Visible = False
Label16.Visible = False
GhostTextBox6.ReadOnly = True
GhostTextBox7.ReadOnly = True
End Sub
Private Sub GhostButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GhostButton1.Click
Select Case String.Empty
Case GhostTextBox1.Text
Label12.Visible = True
Case GhostTextBox2.Text
Label13.Visible = True
Case GhostTextBox5.Text
Label14.Visible = True
Case GhostTextBox6.Text, GhostTextBox7.Text
Label15.Visible = True
Label16.Visible = True
MessageBox.Show("Please choose your Mail Provider", "Mail Provider Not Chosen", MessageBoxButtons.OK, MessageBoxIcon.Error)
Case Else
clear()
s1 = 0
ProgressBar1.Value = 0
ProgressBar1.Update()
GhostButton1.Enabled = False
GhostButton3.Enabled = False
GhostButton2.Enabled = True
If NumericUpDown1.Value = 0 Then
MessageBox.Show("Please select how many mails do you want to sent!", "How many mail to be sent ?", MessageBoxButtons.OK, MessageBoxIcon.Error)
Else
BackgroundWorker1.RunWorkerAsync()
ProgressBar1.Maximum = NumericUpDown1.Value
ProgressBar1.Value = 0
End If
End Select
End Sub
Private Sub BackgroundWorker1_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork
Try
Dim msg As New MailMessage()
msg.From = New MailAddress(GhostTextBox1.Text)
msg.To.Add(GhostTextBox5.Text)
msg.Subject = (GhostTextBox4.Text)
msg.Body = GhostTextBox3.Text
For counter = 0 To ListBox1.Items.Count - 1
Dim Attach As Net.Mail.Attachment = New Net.Mail.Attachment(ListBox1.Items(counter))
msg.Attachments.Add(Attach)
Next
Dim SMTPServer As New SmtpClient
SMTPServer.Host = GhostTextBox6.Text
SMTPServer.Port = GhostTextBox7.Text
SMTPServer.Credentials = New System.Net.NetworkCredential(GhostTextBox1.Text, GhostTextBox2.Text)
SMTPServer.EnableSsl = True
Do Until s1 = NumericUpDown1.Value
If BackgroundWorker1.CancellationPending Then
Exit Sub
End If
SMTPServer.Send(msg)
s1 = s1 + 1
Me.ProgressBar1.Value = s1
Loop
MessageBox.Show("All the Mail has been Sent!", "Mail Sent", MessageBoxButtons.OK, MessageBoxIcon.Information)
ProgressBar1.Value = 0
Catch ex As Exception
MessageBox.Show(ex.ToString)
End Try
End Sub
Private Sub OpenFileDialog1_FileOk(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles OpenFileDialog1.FileOk
For Each fls As String In OpenFileDialog1.FileNames
ListBox1.Items.Add(fls)
Next
End Sub
Private Sub GhostButton4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GhostButton4.Click
OpenFileDialog1.ShowDialog()
End Sub
Private Sub donework(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BackgroundWorker1.RunWorkerCompleted
GhostButton1.Enabled = True
GhostButton3.Enabled = True
GhostButton2.Enabled = False
End Sub
Private Sub GhostButton5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GhostButton5.Click
If ListBox1.Items.Count = 0 Then
MessageBox.Show("No attachments to clear", "No Attachments", MessageBoxButtons.OK, MessageBoxIcon.Error)
Else
ListBox1.Items.Clear()
End If
End Sub
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
Select Case ComboBox1.SelectedIndex
Case 1
GhostTextBox6.ReadOnly = False
GhostTextBox7.ReadOnly = False
Case 2
GhostTextBox6.Text = "smtp.gmail.com"
GhostTextBox7.Text = "587"
Case 3
GhostTextBox6.Text = "smtp.mail.yahoo.com"
GhostTextBox7.Text = "465"
Case 4
GhostTextBox6.Text = "smtp.live.com"
GhostTextBox7.Text = "587"
Case 5
GhostTextBox6.Text = "smtp.aol.com"
GhostTextBox7.Text = "587"
End Select
End Sub
End Class
[You must be registered and logged in to see this link.]
Note:
Both both x64 and x86 exe are there the links
kyle5647- Member
- Posts : 40
Join date : 2014-04-08
Re: Email Spammer
Alright, since you asked for feedback on the code I wanted to go through the entire thing with you.
Where it starts...
Code:
Private Sub GhostButton3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GhostButton3.Click
End
End Sub
Don't use End, it's a VB6 carry over method, meaning it is only there for compatibility.
Code:
Private Sub GhostButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GhostButton2.Click
Try
BackgroundWorker1.CancelAsync()
Catch EX As Exception
End Try
End Sub
You don't need to declare the exception if you don't need to use it, although this is poor. If an exception is thrown because of cancelling, then you are probably not handling anything and just expecting to forcefully cancel the asynchronous operation, ignoring any errors.
What is this BackgroundWorker here for?
Code:
Private WithEvents TestWorker As System.ComponentModel.BackgroundWorker
Code:
ElseIf GhostTextBox6.Text = "" And GhostTextBox7.Text = "" Then
Use AndAlso here to shortcircuit for better performance on the condition checking...
Also in this conditional you are using MsgBox(), which is an ugly carry over from VB6 too.
You also declare this useless TestWorker that doesn't do anything as a new instance of the BackgroundWorker for no reason every time this button is clicked. Not only that, but the BackgroundWorker class implements the IDisposable interface for a reason, and you aren't disposing of ANY of these resources because none of these instances are being Dispose()'d of... This is bad, because when the GC comes along and does it's sweep, garbage collection is a resource intensive task, and it could be avoided more likely if you paid more attention to things like this.
Now, in your BackgroundWorker1_DoWork() event method, there are other classes that implement the IDisposable interface, but you aren't disposing of anything at all... I actually don't see you disposing of anything in this entire source code.
And before I explain about the ProgressBar, this entire bit of code at the end:
Code:
Dim a, b As Integer
Dim np As New System.Drawing.Point
Private Sub GhostTheme1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles GhostTheme1.MouseDown
a = MousePosition.X - Me.Location.X
b = MousePosition.Y - Me.Location.Y
End Sub
Private Sub GhostTheme1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles GhostTheme1.MouseMove
If e.Button = MouseButtons.Left Then
np = MousePosition
np.X = np.X - a
np.X = np.Y - b
End If
End Sub
Is all useless. You are setting values that aren't being used anywhere else in your entire program, and the fact that they are member variables to your Form1 class, their scope is pretty widespread, and you're using up that extra memory on the stack for no reason (because Integer and System.Drawing.Point are value types).
Now as for the ProgressBar, you simply can't update the ProgressBar because a BackgroundWorker runs asynchronously on a new thread. How can you update the ProgressBar, which was created on the UI thread, from a BackgroundWorker thread? You need to invoke the UI thread to do anything with the ProgressBar.
Where it starts...
Code:
Private Sub GhostButton3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GhostButton3.Click
End
End Sub
Don't use End, it's a VB6 carry over method, meaning it is only there for compatibility.
Code:
Private Sub GhostButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GhostButton2.Click
Try
BackgroundWorker1.CancelAsync()
Catch EX As Exception
End Try
End Sub
You don't need to declare the exception if you don't need to use it, although this is poor. If an exception is thrown because of cancelling, then you are probably not handling anything and just expecting to forcefully cancel the asynchronous operation, ignoring any errors.
What is this BackgroundWorker here for?
Code:
Private WithEvents TestWorker As System.ComponentModel.BackgroundWorker
Code:
ElseIf GhostTextBox6.Text = "" And GhostTextBox7.Text = "" Then
Use AndAlso here to shortcircuit for better performance on the condition checking...
Also in this conditional you are using MsgBox(), which is an ugly carry over from VB6 too.
You also declare this useless TestWorker that doesn't do anything as a new instance of the BackgroundWorker for no reason every time this button is clicked. Not only that, but the BackgroundWorker class implements the IDisposable interface for a reason, and you aren't disposing of ANY of these resources because none of these instances are being Dispose()'d of... This is bad, because when the GC comes along and does it's sweep, garbage collection is a resource intensive task, and it could be avoided more likely if you paid more attention to things like this.
Now, in your BackgroundWorker1_DoWork() event method, there are other classes that implement the IDisposable interface, but you aren't disposing of anything at all... I actually don't see you disposing of anything in this entire source code.
And before I explain about the ProgressBar, this entire bit of code at the end:
Code:
Dim a, b As Integer
Dim np As New System.Drawing.Point
Private Sub GhostTheme1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles GhostTheme1.MouseDown
a = MousePosition.X - Me.Location.X
b = MousePosition.Y - Me.Location.Y
End Sub
Private Sub GhostTheme1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles GhostTheme1.MouseMove
If e.Button = MouseButtons.Left Then
np = MousePosition
np.X = np.X - a
np.X = np.Y - b
End If
End Sub
Is all useless. You are setting values that aren't being used anywhere else in your entire program, and the fact that they are member variables to your Form1 class, their scope is pretty widespread, and you're using up that extra memory on the stack for no reason (because Integer and System.Drawing.Point are value types).
Now as for the ProgressBar, you simply can't update the ProgressBar because a BackgroundWorker runs asynchronously on a new thread. How can you update the ProgressBar, which was created on the UI thread, from a BackgroundWorker thread? You need to invoke the UI thread to do anything with the ProgressBar.
Re: Email Spammer
Admin wrote:Alright, since you asked for feedback on the code I wanted to go through the entire thing with you.
Where it starts...
Code:
Private Sub GhostButton3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GhostButton3.Click
End
End Sub
Don't use End, it's a VB6 carry over method, meaning it is only there for compatibility.
Code:
Private Sub GhostButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GhostButton2.Click
Try
BackgroundWorker1.CancelAsync()
Catch EX As Exception
End Try
End Sub
You don't need to declare the exception if you don't need to use it, although this is poor. If an exception is thrown because of cancelling, then you are probably not handling anything and just expecting to forcefully cancel the asynchronous operation, ignoring any errors.
What is this BackgroundWorker here for?
Code:
Private WithEvents TestWorker As System.ComponentModel.BackgroundWorker
Code:
ElseIf GhostTextBox6.Text = "" And GhostTextBox7.Text = "" Then
Use AndAlso here to shortcircuit for better performance on the condition checking...
Also in this conditional you are using MsgBox(), which is an ugly carry over from VB6 too.
You also declare this useless TestWorker that doesn't do anything as a new instance of the BackgroundWorker for no reason every time this button is clicked. Not only that, but the BackgroundWorker class implements the IDisposable interface for a reason, and you aren't disposing of ANY of these resources because none of these instances are being Dispose()'d of... This is bad, because when the GC comes along and does it's sweep, garbage collection is a resource intensive task, and it could be avoided more likely if you paid more attention to things like this.
Now, in your BackgroundWorker1_DoWork() event method, there are other classes that implement the IDisposable interface, but you aren't disposing of anything at all... I actually don't see you disposing of anything in this entire source code.
And before I explain about the ProgressBar, this entire bit of code at the end:
Code:
Dim a, b As Integer
Dim np As New System.Drawing.Point
Private Sub GhostTheme1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles GhostTheme1.MouseDown
a = MousePosition.X - Me.Location.X
b = MousePosition.Y - Me.Location.Y
End Sub
Private Sub GhostTheme1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles GhostTheme1.MouseMove
If e.Button = MouseButtons.Left Then
np = MousePosition
np.X = np.X - a
np.X = np.Y - b
End If
End Sub
Is all useless. You are setting values that aren't being used anywhere else in your entire program, and the fact that they are member variables to your Form1 class, their scope is pretty widespread, and you're using up that extra memory on the stack for no reason (because Integer and System.Drawing.Point are value types).
Now as for the ProgressBar, you simply can't update the ProgressBar because a BackgroundWorker runs asynchronously on a new thread. How can you update the ProgressBar, which was created on the UI thread, from a BackgroundWorker thread? You need to invoke the UI thread to do anything with the ProgressBar.
Thank you for your feedback.
To your first feedback that is why I did use "End", well I dont think this does any harm as it is acceptable in VB.NET though it was derived from VB6 , but from time I will not use this for sure following you.So I will use "Application.Exit()", I hope using this is okay.
Secondly,
for the try catch one, I agree to your point and thanks for clearing the concept.
Thirdly,
Code:
Private WithEvents TestWorker As System.ComponentModel.BackgroundWorker
It is junk , I changed the code later , but I forgot to remove some of statements, I am sorry for that.
fourthly,
Yes, I will use AndAlso , I didnt knew about this, thanks for pointing out.
fifthly,
I don't see any harm in using MsgBox(), it works perfectly.I think thats more important.
Sixth,
Code:
Dim a, b As Integer
Dim np As New System.Drawing.Point
Private Sub GhostTheme1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles GhostTheme1.MouseDown
a = MousePosition.X - Me.Location.X
b = MousePosition.Y - Me.Location.Y
End Sub
Private Sub GhostTheme1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles GhostTheme1.MouseMove
If e.Button = MouseButtons.Left Then
np = MousePosition
np.X = np.X - a
np.X = np.Y - b
End If
End Sub
The above code is my doubt number 2, But I had edited the thread and removed that part.The Source has been edited Now, I have used different functions now, removed MsgBox and End
Thread Updated and progress bar fixed.
Thank you for your suggesttion.
kyle5647- Member
- Posts : 40
Join date : 2014-04-08
Re: Email Spammer
And with all of that in short order, the Author should have a perfectly functioning HC Program ready for use by the Community at large in no time flat.
cloud9- Moderator
- Posts : 38
Join date : 2014-04-09
Age : 34
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
Tue Feb 02, 2021 7:12 am by manas41
» SQL injection and Quote escaping
Sun Jun 28, 2015 11:42 am by ADS1
» [TUT] Chmod: Files & Permissions [TUT]
Thu Jun 04, 2015 12:45 pm by Guest
» Reaver pixiewps
Thu Jun 04, 2015 12:23 pm by voidfletcher
» How To Crash Someone's Skype in 10 SECONDS
Thu Jun 04, 2015 12:20 pm by voidfletcher
» Internet Security & IP Security (IPSec)
Mon May 18, 2015 9:00 pm by voidfletcher
» [Python] Infinite / Definite File Generator
Mon May 18, 2015 8:58 pm by ADS1
» [C#] String Case-Inversion
Mon May 18, 2015 8:57 pm by ADS1
» Rekall Memory Forensic Framework
Sat May 16, 2015 8:55 pm by ADS1