Problema lettura codice pagina HTML

lunedì 17 luglio 2006 - 11.00

gandalf_03_75 Profilo | Junior Member

Ciao a tutti sto cercando di collegarmi ad una pagina del sito isc.sans.org per leggere delle tabelle in essa contenute, per far cio' sto usando la seguente procedura che ho trovato in giro per il web

Private Function SocketSendReceive(ByVal server As String, ByVal port As Integer, Optional ByVal cpage As String = "") As String

'Set up variables and String to write to the server.
Dim ascii As Encoding = Encoding.ASCII
Dim request As String = "GET /" & cpage & " HTTP/1.1" + ControlChars.Cr + ControlChars.Lf + "Host: " + server + ControlChars.Cr + ControlChars.Lf + "Connection: Close" + ControlChars.Cr + ControlChars.Lf + ControlChars.Cr + ControlChars.Lf
Dim bytesSent As [Byte]() = ascii.GetBytes(request)
Dim bytesReceived(255) As [Byte]

' Create a socket connection with the specified server and port.
Dim s As Socket = ConnectSocket(server, port, cpage)

If s Is Nothing Then
Return "Connection failed"
End If
' Send request to the server.
s.Send(bytesSent, bytesSent.Length, 0)

' Receive the server home page content.
Dim bytes As Int32

' Read the first 256 bytes.
Dim page As [String] = "Default HTML page on " + server + ":" + ControlChars.Cr + ControlChars.Lf

' The following will block until the page is transmitted.
Do
bytes = s.Receive(bytesReceived, bytesReceived.Length, 0)
page = page + Encoding.ASCII.GetString(bytesReceived, 0, bytes)
Loop While bytes > 0

Return page
End Function

il problema è che riesco a leggere soltanto i primi 7109 caratteri e nell'ultima riga mi da il seguente messaggio:

<!-- header end -->
Sorry... your bot exceeded the query limit."

Qualcuno ha idea da cosa possa dipendere?
Per i paurosi il futuro resterà sconosciuto, per i deboli sarà irraggiungibile, per gli incoscienti offrirà nuove opportunità.
Partecipa anche tu! Registrati!
Hai bisogno di aiuto ?
Perchè non ti registri subito?

Dopo esserti registrato potrai chiedere
aiuto sul nostro Forum oppure aiutare gli altri

Consulta le Stanze disponibili.

Registrati ora !
Copyright © dotNetHell.it 2002-2025
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5