Code (Text): Imports System.Text.RegularExpressions Imports System.Net Imports System.IO Imports System.Text Imports System.IO.Compression Imports System.Runtime.Serialization.Formatters.Binary Public Class form1 Private Wrapper As New TCPWrapper Private Sub cmdLogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdLogin.Click cmdLogin.Enabled = False txtUser.Enabled = False txtPass.Enabled = False If txtUser.Text = "" Or txtPass.Text = "" Then MsgBox("Username and/or password cannot be blank") cmdLogin.Enabled = True txtUser.Enabled = True txtPass.Enabled = True Else lstLog.Items.Add("Logging in...") lstLog.SelectedIndex = lstLog.Items.Count - 1 Application.DoEvents() Dim Response = Wrapper.NeoLogin(txtUser.Text, txtPass.Text, False) Application.DoEvents() If Response = "Logged In" Then lstLog.Items.Add("Logged in as " + txtUser.Text) cmdLogout.Enabled = True lstLog.SelectedIndex = lstLog.Items.Count - 1 Else lstLog.Items.Add(Response) MsgBox("There was a problem logging in. See log for details") cmdLogin.Enabled = True txtUser.Enabled = True txtPass.Enabled = True lstLog.SelectedIndex = lstLog.Items.Count - 1 End If End If End Sub Private Sub cmdLogout_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdLogout.Click Wrapper.ClearCookies() cmdLogin.Enabled = True cmdLogout.Enabled = False lstLog.Items.Add("Logged Out") txtUser.Text = "" txtPass.Text = "" txtUser.Enabled = True txtPass.Enabled = True lstLog.SelectedIndex = lstLog.Items.Count - 1 End Sub Private Sub cmdStart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdStart.Click progress.Maximum = users.Items.Count() Dim w As New TCPWrapper Timer1.Enabled = True Do While Timer1.Enabled = True w.Request("POST", "http://www.neopets.com/process_neomessages.phtml" & "recipient=" & users.SelectedIndex & "&neofriends=&subject=" & txtsubject.Text & "&message_type=notitle&message_body=" & txtmessage.Text, "http://www.neopets.com/neomessages.phtml?type=send") lstLog.Items.Add(users.SelectedIndex & "has been spammed!") users.SelectedIndex = users.SelectedIndex - 1 progress.Value = progress.Value + 1 If progress.Maximum = progress.Value Then Timer1.Enabled = False lstLog.Items.Add("DONE!" & TimeOfDay) End If w.pause(1) Loop End Sub Private Sub cmdstop_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdstop.Click Timer1.Enabled = False End Sub Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick If Timer1.Enabled = False Then cmdstop.Enabled = False ElseIf Timer1.Enabled = True Then cmdstop.Enabled = True End If End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click users.Items.Clear() End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim objStream As StreamReader, buffer As String = String.Empty, arrFile() As String Dim OD As New OpenFileDialog OD.FileName = "" OD.Multiselect = False OD.Title = "Open List File" OD.AddExtension = True OD.Filter = "Text files (*.txt)|*.txt" OD.DefaultExt = "txt" OD.ShowDialog() If OD.FileName = "" Or OD.CheckFileExists() = False Then Exit Sub objStream = New StreamReader(OD.FileName, True) objStream = File.OpenText(OD.FileName) Do While objStream.EndOfStream = False buffer = objStream.ReadToEnd.ToString Loop arrFile = Regex.Split(buffer, vbCrLf) For i As Integer = 0 To UBound(arrFile) users.Items.Add(arrFile(i)) Next End Sub Private Sub fmrNeoLogin_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click users.Items.Clear() progress.Value = 0 txtmessage.Text = "Message Body" txtsubject.Text = "Subject" Wrapper.ClearCookies() cmdLogin.Enabled = True cmdLogout.Enabled = False lstLog.Items.Add("Logged Out") txtUser.Text = "" txtPass.Text = "" txtUser.Enabled = True txtPass.Enabled = True lstLog.SelectedIndex = lstLog.Items.Count - 1 Timer1.Enabled = False lstLog.Items.Clear() lstLog.Items.Add("Reset program") End Sub End Class Public Class TCPWrapper Inherits System.Windows.Forms.UserControl #Region " Windows Form Designer generated code " Public Sub New() MyBase.New() 'This call is required by the Windows Form Designer. InitializeComponent() 'Add any initialization after the InitializeComponent() call End Sub 'UserControl overrides dispose to clean up the component list. Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) If disposing Then If Not (components Is Nothing) Then components.Dispose() End If End If MyBase.Dispose(disposing) End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent() components = New System.ComponentModel.Container End Sub #End Region Private colCookies As New Collection Dim strCookies As String Public LastPage As String Public Function Request(ByVal Method As String, ByVal URL As String, ByVal Referer As String) As String Dim Host As String = Nothing Dim strFile As String = Nothing Dim strPost As String = Nothing Dim pos As Integer = 0 If Referer Is Nothing Then Referer = LastPage End If If URL.Contains("http://") Then Host = URL.Substring(7) Else Host = URL End If If Host.Contains("/") Then pos = Host.IndexOf("/", 0) strFile = Host.Substring(pos) Host = Host.Substring(0, pos) Else strFile = "/" End If If Method = "POST" Then pos = strFile.IndexOf("?") If Not (pos = -1) Then strPost = strFile.Substring(pos + 1) strFile = strFile.Substring(0, pos) Else strPost = Nothing End If End If If Method = "POST2" Then pos = strFile.IndexOf("?") If Not (pos = -1) Then strPost = strFile.Substring(pos + 1) strFile = strFile.Substring(0, pos) Else strPost = "" End If End If LastPage = URL Dim ReqHeaders As String = Nothing If Method = "GET" OrElse Method = "PIC" Then ReqHeaders = "GET" + " " + strFile + " HTTP/1.1" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Host: " + Host + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.8.0.7) Gecko/20060909 Firefox/1.5.0.7" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Accept-Language: en-us,en;q=0.5" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Accept-Encoding: gzip, deflate" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Keep-Alive: 300" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Connection: keep-alive" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Referer: " + Referer + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Cookie: " + strCookies + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" Else ReqHeaders = "POST " + strFile + " HTTP/1.1" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Host: " + Host + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.8.0.7) Gecko/20060909 Firefox/1.5.0.7" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Accept-Language: en-us,en;q=0.5" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Accept-Encoding: gzip, deflate" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Keep-Alive: 300" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Connection: keep-alive" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Referer: " + Referer + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Cookie: " + strCookies + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Content-Type: application/x-www-form-urlencoded" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Content-Length: " + strPost.Length.ToString + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Connection: close" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + strPost End If If Method = "PIC" Then ReqHeaders.Replace("Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5", "Accept: image/png,*/*;q=0.5") End If Dim tcp As New System.Net.Sockets.TcpClient Dim netstream As System.Net.Sockets.NetworkStream Dim TN(1) As Long If Referer = "" Then Referer = LastPage If InStr(1, URL, "http://") <> 0 Then Host = Mid$(URL, 8) If InStr(1, Host, "/") <> 0 Then Host = Mid$(Host, 1, InStr(1, Host, "/") - 1) If InStr(1, Host, "?") <> 0 Then Host = Mid$(Host, 1, InStr(1, Host, "?") - 1) LastPage = URL Try tcp.Connect(Host, 80) Catch ex As Exception Return ex.Message End Try Dim sendbytes As Byte() sendbytes = System.Text.Encoding.ASCII.GetBytes(ReqHeaders) netstream = tcp.GetStream() netstream.Write(sendbytes, 0, sendbytes.Length) Dim sr As StreamReader = New StreamReader(netstream, Encoding.Default) Dim strHTML As String = sr.ReadToEnd Dim strParts As String() = Regex.Split(strHTML, Environment.NewLine + Environment.NewLine) strCookies = ParseCookies(strParts(0)) If strParts(0).Contains("Content-Encoding") Then strParts(1) = DecompressGzip(strParts(1)) End If Return strParts(0) + Environment.NewLine + Environment.NewLine + strParts(1) End Function Public Function DecompressGzip(ByVal compressed As String) As String Dim memStream As MemoryStream = New MemoryStream(System.Text.Encoding.Default.GetBytes(compressed)) Dim decompressStream As GZipStream = New GZipStream(memStream, CompressionMode.Decompress) Dim endBytes(4) As Byte Dim position As Integer = CType(memStream.Length, Integer) - 4 memStream.Position = position memStream.Read(endBytes, 0, 4) memStream.Position = 0 Dim buffer(BitConverter.ToInt32(endBytes, 0) + 100) As Byte Dim offset As Integer = 0 Dim total As Integer = 0 While True Dim bytesRead As Integer = decompressStream.Read(buffer, offset, 100) If bytesRead = 0 Then Exit While End If offset += bytesRead total += bytesRead End While Return Encoding.ASCII.GetString(buffer) End Function Public Function ParseCookies(ByVal Headers As String) As String ParseCookies = "" Dim reg As Regex Dim matches As MatchCollection Dim match As Match reg = New Regex("set-cookie:\s*([^=]+)=([^;]+);", RegexOptions.IgnoreCase) If reg.IsMatch(Headers) Then matches = reg.Matches(Headers) For Each match In matches Try colCookies.Add(match.Groups(1).ToString & "=" & match.Groups(2).ToString, match.Groups(1).ToString) Catch ex As Exception colCookies.Remove(match.Groups(1).ToString) colCookies.Add(match.Groups(1).ToString & "=" & match.Groups(2).ToString, match.Groups(1).ToString) End Try Next End If Dim i As Long For i = 1 To colCookies.Count Step 1 ParseCookies = ParseCookies & colCookies.Item(i).ToString & ";" Next End Function Public Function StripHeaders(ByVal strSource As String) As String Dim strParts() As String = Regex.Split(strSource, Environment.NewLine + Environment.NewLine) Return strParts(1) End Function Public Function NeoLogin(ByVal user As String, ByVal pass As String, ByRef loggedIn As Boolean) As String Dim strHTML As String = Nothing Request("GET", "http://www.neopets.com/loginpage.phtml", "http://www.google.com") Pause(1) Request("POST", "http://www.neopets.com/hi.phtml?destination=%2Findex.phtml&username=" + user, "http://www.neopets.com/loginpage.phtml") Pause(1) strHTML = Request("POST", "http://www.neopets.com/login.phtml?username=" + user + "&password=" + pass + "&destination=%2Findex.phtml", "http://www.neopets.com/hi.phtml") If strHTML.Contains("Set-Cookie: neologin=") Then loggedIn = True Return "Logged In" Else If strHTML.Contains("too many times") Then loggedIn = False Return "To Many Login Attempts" Else If strHTML.Contains("badpassword") Then loggedIn = False Return "Wrong Username/Password" Else If strHTML.Contains("frozen") Then loggedIn = False Return "Account Frozen" Else If strHTML.Contains("just a technical problem") Then loggedIn = False Return "Neopets is down for maintenance" Else loggedIn = False Return "Unknow Error" End If End If End If End If End If End Function Public Sub Pause(ByVal seconds As Double) Dim num As Double = seconds * 1000 Dim t1 As DateTime = DateTime.Now Dim t2 As DateTime = DateTime.Now Dim tmDiff As TimeSpan = t2 - t1 While Convert.ToDouble(tmDiff.TotalMilliseconds.ToString) < num t2 = DateTime.Now tmDiff = t2 - t1 Application.DoEvents() End While End Sub Public Function GrabPic(ByVal strURL As String) As System.Drawing.Image Dim memStream As New MemoryStream(System.Text.Encoding.Default.GetBytes(StripHeaders(Request("GET", strURL, LastPage)))) GrabPic = Image.FromStream(memStream) Return GrabPic End Function Public Sub ClearCookies() colCookies.Clear() strCookies = Nothing End Sub Public Function GetBetween(ByVal Source As String, ByVal Start As String, ByVal Finish As String) As String Dim Result = "" Dim A = InStr(1, Source, Start) + Len(Start) If A = 0 Then Result = "" Return Result Else Dim B = InStr(A, Source, Finish) If B = 0 Then Result = "" Return Result Else Result = Mid(Source, A, B - A) Return Result End If End If End Function Public Function GetRefCk(ByVal Source As String) As String Dim StringPosition = InStr(Source, "_ref_ck") Source = Source.Remove(0, StringPosition) StringPosition = InStr(Source, "value") Source = Source.Remove(0, StringPosition + 6) StringPosition = InStr(Source, ">") Source = Source.Remove(StringPosition - 2, Source.Length - (StringPosition - 2)) Return Source End Function End Class Figure out whats wrong and I will seriously love you to death XD I went through the program and I can't find anything wrong. But when I push the "Start" button (cmdstart) the program freezes...
There is no mutual relation between my grammar and my VB.net skills because VB.net has an error console for spelling mistakes.
Code (Text): w.Request("POST", "http://www.neopets.com/process_neomessages.phtml" & "recipient=" & users.SelectedIndex & "&neofriends=&subject=" & txtsubject.Text & "&message_type=notitle&message_body=" & txtmessage.Text, "http://www.neopets.com/neomessages.phtml?type=send") ^ Here's the fail You have to divide the URL from the postdata by putting a questionmark '?' in-between them. Code (Text): w.Request("POST", "http://www.neopets.com/process_neomessages.phtml?recipient=" & users.SelectedIndex & "&neofriends=&subject=" & txtsubject.Text & "&message_type=notitle&message_body=" & txtmessage.Text, "http://www.neopets.com/neomessages.phtml?type=send")
O-M-F-G RICKY!!!!!!! Spoiler <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3<3 <3 <3 <3 <3 <3 <3 <3 <3<3 <3 <3 <3 <3 <3 <3 <3 <3<3 <3 <3 <3 <3 <3 <3 <3 <3<3 <3 <3 <3 <3 <3 <3 <3 <3<3 <3 <3 <3 <3 <3 <3 <3 <3<3 <3 <3 <3 <3 <3 <3 <3 <3<3 <3 <3 <3 <3 <3 <3 <3 <3<3 <3 <3 <3 <3 <3 <3 <3 <3<3 <3 <3 <3 <3 <3 <3 <3 <3<3 <3 <3 <3 <3 <3 <3 <3 <3<3 <3 <3 <3 <3 <3 <3 <3 <3<3 <3 <3 <3 <3 <3 <3 <3 <3<3 <3 <3 <3 <3 <3 <3 <3 <3<3 <3 <3 <3 <3 <3 <3 <3 <3<3 <3 <3 <3 <3 <3 <3 <3 <3<3 <3 <3 <3 <3 <3 <3 <3 <3<3 <3 <3 <3 <3 <3 <3 <3 <3<3 <3 <3 <3 <3 <3 <3 <3 <3<3 <3 <3 <3 <3 <3 <3 <3 <3<3 <3 <3 <3 <3 <3 <3 <3 <3<3 <3 <3 <3 <3 <3 <3 <3 <3<3 <3 <3 <3 <3 <3 <3 <3 <3<3 <3 <3 <3 <3 <3 <3 <3 <3<3 <3 <3 <3 <3 <3 <3 <3 <3<3 <3 <3 <3 <3 <3 <3 <3 <3<3 <3 <3 <3 <3 <3 <3 <3 <3<3 <3 <3 <3 <3 <3 <3 <3 <3<3 <3 <3 <3 <3 <3 <3 <3 <3<3 <3 <3 <3 <3 <3 <3 <3 <3<3 <3 <3 <3 <3 <3 <3 <3 <3<3 <3 <3 <3 <3 <3 <3 <3 <3<3 <3 <3 <3 <3 <3 <3 <3 <3<3 <3 <3 <3 <3 <3 <3 <3 <3<3 <3 <3 <3 <3 <3 <3 <3 <3<3 <3 <3 <3 <3 <3 <3 <3 <3<3 <3 <3 <3 <3 <3 <3 <3 <3<3 <3 <3 <3 <3 <3 <3 <3 <3<3 <3 <3 <3 <3 <3 <3 <3 <3<3 <3 <3 <3 <3 <3 <3 <3 <3<3 <3 <3 <3 <3 <3 <3 <3 <3<3 <3 <3 <3 <3 <3 <3 <3 <3<3 <3 <3 <3 <3 <3 <3 <3 <3<3 <3 <3 <3 <3 <3 <3 <3 <3<3 <3 <3 <3 <3 <3 <3 <3 <3<3 <3 <3 <3 <3 <3 <3 <3 <3<3 <3 <3 <3 <3 <3 <3 <3 <3<3 <3 <3 <3 <3 <3 <3 <3 <3<3 <3 <3 <3 <3 <3 <3 <3 <3<3 <3 <3 <3 <3 <3 <3 <3 <3<3 <3 <3 <3 <3 <3 <3 <3 <3<3 <3 <3 <3 <3 <3 <3 <3 THAT WASN'T EVEN COPY+PASTED!! I CLICKED THEM OUT 1 BY ONE!!! I LOVE YOU!!!!! <3 Ricky: You wearing glasses: Thats brad pitt by the way XD. Anyways... Tharoux/Ricky: Code (Text): users.SelectedIndex = users.SelectedIndex - 1 I put that after the sending the message post. However, it is making the program freeze. I am trying to make it so it doesn't spam the same user over and over again, but rather a new user from the users listbox. How do I properly set users.selectedindex to the next user?
a +1 would be a good start. let's say you have 10 items (index from 0 to 9) If you do -1, you're in trouble.
...OH!! LOL I thought it was - for down, not - for up... XD My bad. THANK YOU THAROUX! I'ma go test my neomail spammer now.
:lol: That was the extent of my programming knowledge, use lots of brackets/ifs and END at the end xD
SoCode ftw.[/quote] import java.net.MalformedFexxelException; If (coder.equals("Fexxel")) { System.out.println("Program Failure"); } i created a Malformed Fexxel Exception just for you fexxel