Advertisement
Guest User

Untitled

a guest
Aug 5th, 2016
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 1.60 KB | None | 0 0
  1.   ' make a request and grab the source
  2.         Dim sSource As String = MakePostRequest(_ForumURL & "member.php", sPost)
  3.  
  4.         ' if we need to handle the captcha
  5.         If sSource.Contains("captcha_img") Then
  6.  
  7.             ' tell the user what we're doing
  8.             RaiseEvent StatusReceived("Captcha needed")
  9.  
  10.             ' get the imagehash needed to fetch the captcha
  11.             Dim sFind As String = "?imagehash="
  12.             Dim sImageHash As String = sSource.Substring(sSource.IndexOf(sFind) + sFind.Length, 32)
  13.  
  14.             ' tell the user what we're doing
  15.             RaiseEvent StatusReceived("Fetching Captcha..")
  16.  
  17.             ' create an instance of frmCaptcha
  18.             Dim fCaptcha As New frmCaptcha
  19.  
  20.             ' fetch the captcha and set the image in frmCaptcha
  21.             fCaptcha.CaptchaImage = FetchCaptch(sImageHash)
  22.  
  23.             ' show dialoge prevents them from using frmMain
  24.             fCaptcha.ShowDialog()
  25.  
  26.             ' grab what they typed in then dispose the form
  27.             Dim sImgageString As String = fCaptcha.Answer
  28.             fCaptcha.Dispose()
  29.  
  30.             ' create new post data
  31.             sPost = "username=" & Username & "&password=" & Password + "&remember=yes" + "&imagestring=" + sImgageString + "&imagehash=" + sImageHash + "&submit=Login&action=do_login&url=" & _ForumURL & "member.php?action=login"
  32.  
  33.             ' tell the user what we're doing
  34.             RaiseEvent StatusReceived("Sending Captcha")
  35.  
  36.             ' send the captcha and grab a new source
  37.             sSource = MakePostRequest(_ForumURL & "member.php", sPost)
  38.  
  39.         End If
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement