i try to use webrequest , Get method to login to this page but i failed.. can you help me pleze
[XCODE]
[/XCODE]
[XCODE]
VB.NET:
Dim CookieJar As New CookieContainer
Dim req As HttpWebRequest = HttpWebRequest.Create("http://69.207.166.218/index.htm")
Dim authInfo As String = "Polycom" + ":" + "46837"
authInfo = Convert.ToBase64String(Encoding.Default.GetBytes(authInfo))
With req
.Headers.Add("Authorization", "Basic UG9seWNvbTo0NjgzNw==")
.Method = "GET"
.Host = "69.207.166.218"
.Headers.Add("Accept-Language", "en-US,en;q=0.5")
.Headers.Add("Accept-Encoding", "gzip, deflate")
.Headers.Add("X-Requested-With", "XMLHttpRequest")
.Accept = "*/*"
.ContentType = "text/html"
.Referer = "http://69.207.166.218/"
.UserAgent = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:57.0) Gecko/20100101 Firefox/57.0"
End With
Dim text As String = ""
Dim response As HttpWebResponse = Nothing
response = DirectCast(req.GetResponse(), HttpWebResponse)
Dim receiveStream As StreamReader = Nothing
receiveStream = New StreamReader(response.GetResponseStream())
Dim strOutput As String = receiveStream.ReadToEnd()
receiveStream.Close()
response.Close()
TextBox1.Text = strOutput
WebBrowser1.DocumentText = strOutput