locked
Help with error: The server committed a protocol violation.

    السؤال

  • im trying to either download a webpage source or get the source and load it into a variable but i keep getting an error:

    The server committed a protocol violation. Section=ResponseHeader Detail='Content-Length' header value is invalid

     Public Sub DL_webpage(ByVal url As String)
            Dim client As WebClient = New WebClient()
            Dim stream As Stream = client.OpenRead(url)
            Dim sr As StreamReader = New StreamReader(stream)
            Main.RichTextBox1.Text = sr.ToString
        End Sub
    the url looks something like this
    http://192.168.1.6/var/mobile/Media/iTunes_Control/Music/F01

    i heard you need this but i dont know where to put it in my settings
    <configuration>
     <system.net>
     <settings>
     <httpWebRequest useUnsafeHeaderParsing="true" />
     </settings>
     </system.net>
     </configuration>

    16/صفر/1431 01:27 ص

جميع الردود

  • im trying to either download a webpage source or get the source and load it into a variable but i keep getting an error:

    The server committed a protocol violation. Section=ResponseHeader Detail='Content-Length' header value is invalid

     Public Sub DL_webpage(ByVal url As String)
            Dim client As WebClient = New WebClient()
            Dim stream As Stream = client.OpenRead(url)
            Dim sr As StreamReader = New StreamReader(stream)
            Main.RichTextBox1.Text = sr.ToString
        End Sub
    
    the url looks something like this
    http://192.168.1.6/var/mobile/Media/iTunes_Control/Music/F01

    i heard you need this but i dont know where to put it in my settings
    <configuration>
     <system.net>
     <settings>
     <httpWebRequest useUnsafeHeaderParsing="true" />
     </settings>
     </system.net>
     </configuration>

    http://social.msdn.microsoft.com/Forums/en-US/netfxnetcom/thread/db058dc1-4488-489d-97b3-3adda75d5967
    Just Be Humble Malange!
    16/صفر/1431 03:43 م
  • Thank you for the reply but it didnt help iv already seen that before
    19/صفر/1431 12:16 ص