Advertisement
Guest User

Untitled

a guest
Jan 26th, 2018
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.05 KB | None | 0 0
  1.  
  2. Public Function Checkusername(ByVal user As String) As Object
  3. Dim result As Object = False
  4. Dim cookieContainer As CookieContainer = New CookieContainer()
  5. Application.DoEvents()
  6. Try
  7. Dim s As String = String.Concat(New String() {"email=givsfghsfghsfghsfghsfgheaway.emaisfghsfghsl01%2Bewlfle", user, "wlfsfghsfghsfghfsghsfghsfghsfghsfghsfghew%40gmail.com&password=Sw2xishere&username=", user, "&first_name=Sw2x"})
  8. Dim httpWebRequest As HttpWebRequest = CType(WebRequest.Create("https://www.instagram.com/accounts/web_create_ajax/attempt/"), HttpWebRequest)
  9. httpWebRequest.Method = "POST"
  10. httpWebRequest.Host = "www.instagram.com"
  11. httpWebRequest.UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20100101 Firefox/16.0"
  12. httpWebRequest.Headers.Add("X-CSRFToken", "Ksxp4bSKAoX0sJhSdXH1Y58LzCvQbqbV")
  13. httpWebRequest.ContentType = "application/x-www-form-urlencoded; charset=UTF-8"
  14. httpWebRequest.Headers.Add("X-Requested-With", "XMLHttpRequest")
  15. httpWebRequest.Headers.Add("Cookie", "csrftoken=Ksxp4bSKAoX0sJhSdXH1Y58LzCvQbqbV; ds_user_id=3527398730; mid=V4RDNgAEAAEVQHfeBMMKmFqJAgHZ")
  16. httpWebRequest.KeepAlive = True
  17. httpWebRequest.Referer = "https://www.instagram.com/"
  18. httpWebRequest.Timeout = 1000000
  19. Dim bytes As Byte() = Encoding.ASCII.GetBytes(s)
  20. httpWebRequest.ContentLength = CLng(bytes.Length)
  21. Dim requestStream As Stream = httpWebRequest.GetRequestStream()
  22. requestStream.Write(bytes, 0, bytes.Length)
  23. requestStream.Flush()
  24. requestStream.Close()
  25. Dim flag As Boolean = New StreamReader(CType(httpWebRequest.GetResponse(), HttpWebResponse).GetResponseStream()).ReadToEnd().Contains("true")
  26. If flag Then
  27. result = True
  28. End If
  29. Catch expr_171 As Exception
  30.  
  31. result = False
  32.  
  33. End Try
  34. Return result
  35. End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement