Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System.Net
- Imports System.IO
- Imports System.Text
- Public Class Form1
- Function login()
- Dim user$
- Dim pass$
- user = TextBox1.Text
- pass = TextBox2.Text
- Dim postData As String = "username=" + user + "&password=" + pass
- Dim reQ As HttpWebRequest = DirectCast(WebRequest.Create("https://www.instagram.com/accounts/login/ajax/"), HttpWebRequest)
- reQ.Method = "POST"
- reQ.UserAgent = "Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36"
- reQ.Headers.Add("x-csrftoken", "hWKHz7v5O4m7FnpYPpOL6uLdTgsUnrhN")
- reQ.Headers.Add("x-instagram-ajax", "1")
- reQ.ContentType = "application/x-www-form-urlencoded"
- reQ.Headers.Add("x-requested-with", "XMLHttpRequest")
- reQ.Headers.Add("cookie", "mid=WWi8YwALAAFHlq4KsNJtVccVu2K5; ig_vw=1366; ig_pr=1; rur=FRC; csrftoken=hWKHz7v5O4m7FnpYPpOL6uLdTgsUnrhN")
- reQ.Referer = "https://www.instagram.com/"
- reQ.KeepAlive = True
- Dim bytes As Byte() = Encoding.UTF8.GetBytes(postData)
- reQ.ContentLength = bytes.Length
- Dim reQS As Stream = reQ.GetRequestStream
- reQS.Write(bytes, 0, bytes.Length)
- reQS.Close()
- Dim res As HttpWebResponse
- res = DirectCast(reQ.GetResponse(), HttpWebResponse)
- Dim Reader As New StreamReader(res.GetResponseStream)
- Dim page As String = Reader.ReadToEnd
- If page.Contains("false") Then
- WebBrowser1.DocumentText = page
- MsgBox("Failed Login : " + user)
- Else
- WebBrowser1.DocumentText = page
- MsgBox("Successfully Login : " + user)
- End If
- 'كذا يكون خلصنا الفنكشن ! نجربه
- End Function
- Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
- login()
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement