Advertisement
Guest User

Login Function

a guest
May 15th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. Function Check(username As String, pass As String)
  2. Try
  3. Dim postData As String = "username=" & username & "&password=" & pass
  4. Dim req As HttpWebRequest
  5. req = WebRequest.Create("https://www.instagram.com/accounts/login/ajax/")
  6. Dim res As HttpWebResponse
  7. Dim en As Byte() = Encoding.UTF8.GetBytes(postData)
  8. req.Method = "POST"
  9. req.ContentType = "application/x-www-form-urlencoded"
  10. req.Headers.Add("X-CSRFToken", "ZxEWIjHiwFGMxQVpB0L5nkLXriSs1wN4")
  11. req.Headers.Add("X-Instagram-AJAX", "1")
  12. req.Headers.Add("X-Requested-With", "XMLHttpRequest")
  13. req.Headers.Add("Cookie", "rur=ATN; csrftoken=ZxEWIjHiwFGMxQVpB0L5nkLXriSs1wN4; mid=WRmszQALAAH3-sfP8J7hcMRCbK2L; ig_vw=1366; ig_pr=1")
  14. req.Referer = "https://www.instagram.com/"
  15. req.ContentLength = en.Length
  16. Dim ss As Stream = req.GetRequestStream
  17. ss.Write(en, 0, en.Length)
  18. ss.Close()
  19. res = req.GetResponse
  20. Dim re As New StreamReader(res.GetResponseStream)
  21. Dim ST = re.ReadToEnd
  22. TextBox1.AppendText(ST)
  23. If ST.Contains(My.Resources.{"authenticated": true, "user": true, "status": "ok"}) Then
  24. MsgBox("Login Good")
  25. Else
  26. MsgBox("Bad")
  27. End If
  28. Catch ex As Exception
  29. Return False
  30. End Try
  31. End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement