Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 42292

VS 2010 Facebook Login Issue

$
0
0
I'm having this issue with this Facebook login that i made what can be the error




Code:

  Dim logincookie As CookieContainer

    Sub login(ByVal email As String, ByVal password As String)
        If txtEmail.Text = String.Empty AndAlso txtPass.Text = String.Empty Then
            MsgBox("Put your email & password", 0, "Input data")
        Else
            Dim postData As String = "email=" & email & "&pass=" & password & ""
            Dim tempcookies As New CookieContainer
            Dim encoding As New UTF8Encoding
            Dim byteData As Byte() = encoding.GetBytes(postData)
            Dim postreq As HttpWebRequest = DirectCast(HttpWebRequest.Create("https://www.facebook.com/login.php?iphone&next=http%3A%2F%2Ftouch.facebook.com%2Findex.php%3Feu%3DD0sS06p7LA4Jn5QzzqNH​Qg&refsrc=http%3A%2F%2Ftouch.facebook.com%2F"), HttpWebRequest)
            postreq.Method = "POST"
            postreq.KeepAlive = True
            postreq.CookieContainer = tempcookies
            postreq.UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0b6pre) Gecko/20100903 Firefox/4.0b6pre"
            postreq.ContentType = "application/x-www-form-urlencoded"
            postreq.Referer = "http://touch.facebook.com/login.php?next=http%3A%2F%2Ftouch.facebook.com%2Findex.php%3Feu%3DD0sS06p7LA4Jn5​QzzqNHQg&refsrc=http%3A%2F%2Ftouch.facebook.com%2F&_rdr"
            postreq.ContentLength = byteData.Length
            Dim postreqstream As Stream = postreq.GetRequestStream()
            postreqstream.Write(byteData, 0, byteData.Length)
            postreqstream.Close()
            Dim postresponse As HttpWebResponse
            postresponse = DirectCast(postreq.GetResponse, HttpWebResponse)
            tempcookies.Add(postresponse.Cookies)
            logincookie = tempcookies
            Dim postreqreader As New StreamReader(postresponse.GetResponseStream())
            Dim thepage As String = postreqreader.ReadToEnd
            If thepage.Contains("Incorrect email/password combination") = True Then
                MsgBox("Incorrect email/password combination", 0, "Login error!")
            Else
                MsgBox("Logged in", 0, "Success!")
            End If
            If thepage.Contains("You have exceeded the number of invalid login attempts that we allow for your account") = True Then
                MsgBox("You have exceeded the number of invalid login attempts", 0, "Max number of wrong logins")
            End If
        End If
    End Sub

Button 1

Code:


login(txtEmail.Text, txtPass.Text)


Viewing all articles
Browse latest Browse all 42292

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>