Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Function check_username(username As String)
- Try
- Dim post As String = "subdomain=" & username
- Dim UTF8Encoding As New UTF8Encoding
- Dim byte1 As Byte() = UTF8Encoding.GetBytes(post)
- Dim request As HttpWebRequest = DirectCast(WebRequest.Create("https://www.sarahah.com/Account/SubdomainExists"), HttpWebRequest)
- request.Method = "POST"
- request.Accept = "*/*"
- request.KeepAlive = True
- request.ContentType = "application/x-www-form-urlencoded; charset=UTF-8"
- request.Headers.Add("X-Requested-With", "XMLHttpRequest")
- request.Proxy = Nothing
- request.ContentLength = byte1.Length
- 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"
- request.Host = "www.sarahah.com"
- Dim Stream As Stream = request.GetRequestStream()
- Stream.Write(byte1, 0, byte1.Length)
- Stream.Flush()
- Stream.Close()
- Dim ResponseStream As HttpWebResponse = DirectCast(request.GetResponse(), HttpWebResponse)
- Dim StreamReader As New StreamReader(ResponseStream.GetResponseStream())
- Dim Response As String = StreamReader.ReadToEnd
- If Response.Contains("true") Then
- MsgBox("Taken")
- Else
- If Response.Contains("false") Then
- MsgBox("Available")
- End If
- End If
- Catch ex As Exception
- MsgBox("Error")
- End Try
- Return False
- End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement