Results 1 to 2 of 2

Thread: Login to this page with webrequest (Polycom page)

  1. #1
    .NET Framework
    .NET 4.0
    Join Date
    Jan 2018

    Login to this page with webrequest (Polycom page)

    i try to use webrequest , Get method to login to this page but i failed.. can you help me pleze

    Dim CookieJar As New CookieContainer
                Dim req As HttpWebRequest = HttpWebRequest.Create("")
                Dim authInfo As String = "Polycom" + ":" + "46837"
                authInfo = Convert.ToBase64String(Encoding.Default.GetBytes(authInfo))
                With req
                    .Headers.Add("Authorization", "Basic UG9seWNvbTo0NjgzNw==")
                    .Method = "GET"
                    .Host = ""
                    .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 = ""
                     .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()
                TextBox1.Text = strOutput
                WebBrowser1.DocumentText = strOutput

  2. #2
    .NET Framework
    .NET 4.0
    Join Date
    Aug 2004
    Sydney, Australia
    With regards to fomatting code snippets, you don't use both xcode and code tags. Use one or the other. If you use xcode then you need to provide the appropriate formatting option, which is VB, e.g.

    [xcode=vb]your code here[/xcode]

    That is the preferred option unless you want to add extra formatting, e.g. bold or colour.

Similar Threads

  1. Question webrequest refresh page
    By Zexor in forum Net / Sockets
    Replies: 0
    Last Post: 01-23-2014, 3:00 AM
  2. Using Webrequest to log in and write source of another page to file?
    By in forum Net / Sockets
    Replies: 0
    Last Post: 09-03-2011, 7:10 PM
  3. Question After login-validation page is not directing to targeted page
    By eshack in forum Web Security
    Replies: 1
    Last Post: 07-06-2011, 9:33 AM
  4. Replies: 1
    Last Post: 10-11-2010, 1:28 PM
  5. Screen scraping a page behind HTTPS login page
    By leedo2k in forum Net / Sockets
    Replies: 1
    Last Post: 11-18-2008, 10:25 AM


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts