24-09-17, 11:32 PM
السلام عليكم ،
اريد ان اسجل دخول في موقع : https://disqus.com/profile/login
عن طريق POST HTTP
هذا كودي :
اريد ان اسجل دخول في موقع : https://disqus.com/profile/login
عن طريق POST HTTP
هذا كودي :
كود :
Dim loginc As CookieContainer
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim email As String = "test@gmail.com"
Dim password As String = "12345"
Dim pos As String = "csrfmiddlewaretoken=s41gFQlGq1YwQRh066AhoF5cWRQtcVTV&username=" & email & "&password=" & password
Dim tempcoo As New CookieContainer
Dim encoding As New UTF8Encoding
Dim bytedata As Byte() = encoding.GetBytes(pos)
Dim req As HttpWebRequest = DirectCast(WebRequest.Create("https://disqus.com/profile/login"), HttpWebRequest)
req.Method = "POST"
req.KeepAlive = True
req.UseDefaultCredentials = True
req.CookieContainer = tempcoo
req.ContentType = "application/x-www-form-urlencoded"""
req.Referer = "https://disqus.com/profile/login/?next=https://disqus.com"
req.UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:50.0) Gecko/20100101 Firefox/50.0"
req.ContentLength = bytedata.Length
Dim pstre As Stream = req.GetRequestStream()
pstre.Write(bytedata, 0, bytedata.Length)
pstre.Close()
Dim respo As HttpWebResponse
respo = DirectCast(req.GetResponse(), HttpWebResponse)
tempcoo.Add(respo.Cookies)
loginc = tempcoo
Dim reader As New StreamReader(respo.GetResponseStream)
Dim thepage As String = reader.ReadToEnd
RichTextBox1.Text = thepage
End Sub
ولكن على ماعتقد لا يسجل دخول !! او بالاصح لا اعرف ان سجل دخول او لم يسجل
هل من مساعدة .. ارجوكم