Advertisement
killers07z

@oses - Sarahah Check

Jun 18th, 2020
535
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  Function check_username(username As String)
  2.         Try
  3.             Dim post As String = "subdomain=" & username
  4.             Dim UTF8Encoding As New UTF8Encoding
  5.             Dim byte1 As Byte() = UTF8Encoding.GetBytes(post)
  6.             Dim request As HttpWebRequest = DirectCast(WebRequest.Create("https://www.sarahah.com/Account/SubdomainExists"), HttpWebRequest)
  7.             request.Method = "POST"
  8.             request.Accept = "*/*"
  9.             request.KeepAlive = True
  10.             request.ContentType = "application/x-www-form-urlencoded; charset=UTF-8"
  11.             request.Headers.Add("X-Requested-With", "XMLHttpRequest")
  12.             request.Proxy = Nothing
  13.             request.ContentLength = byte1.Length
  14.             request.UserAgent = "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36"
  15.             request.Host = "www.sarahah.com"
  16.             Dim Stream As Stream = request.GetRequestStream()
  17.             Stream.Write(byte1, 0, byte1.Length)
  18.             Stream.Flush()
  19.             Stream.Close()
  20.             Dim ResponseStream As HttpWebResponse = DirectCast(request.GetResponse(), HttpWebResponse)
  21.             Dim StreamReader As New StreamReader(ResponseStream.GetResponseStream())
  22.             Dim Response As String = StreamReader.ReadToEnd
  23.             If Response.Contains("true") Then
  24.                 MsgBox("Taken")
  25.             Else
  26.                 If Response.Contains("false") Then
  27.                     MsgBox("Available")
  28.                 End If
  29.             End If
  30.         Catch ex As Exception
  31.             MsgBox("Error")
  32.         End Try
  33.         Return False
  34.     End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement