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
    Posts
    1
    Reputation
    0

    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

    [XCODE]
    Code:
    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
    [/XCODE]

  2. #2
    .NET Framework
    .NET 4.0
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    13,995
    Reputation
    1727
    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, 2:00 AM
  2. Using Webrequest to log in and write source of another page to file?
    By xsirthomasx@gmail.com in forum Net / Sockets
    Replies: 0
    Last Post: 09-03-2011, 6: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, 8:33 AM
  4. Replies: 1
    Last Post: 10-11-2010, 12:28 PM
  5. Screen scraping a page behind HTTPS login page
    By leedo2k in forum Net / Sockets
    Replies: 1
    Last Post: 11-18-2008, 9:25 AM

Bookmarks

Posting Permissions

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