hot Get source page from internet

ocal

Member
Joined
Apr 24, 2009
Messages
5
Programming Experience
5-10
Hi all
i want to get page source from anu url .
i can di it in visual basic 6 . but in vb.net i donna i want use what .

plz help me !
 
use socket , connect , get the source code , if ya can't find any source , let me know to give u some
 
umm u said at first u want a page source code ,
there is some methods tht u can gain the source code , with web browsers object u can ,or with :
VB.NET:
    Dim client As New Net.Sockets.TcpClient
    client.Connect("ur ip", 80)
    Dim writer As New IO.StreamWriter(client.GetStream)
    Dim reader As New IO.StreamReader(client.GetStream)
    writer.WriteLine("GET ur url")
    writer.WriteLine("Host: ur ip")
    writer.WriteLine()
    writer.Flush()
    Dim sb As New System.Text.StringBuilder
    While reader.Peek <> -1
        sb.AppendLine(reader.ReadLine)
    End While
    writer.Close()
    reader.Close()
    client.Close()
    MsgBox(sb.ToString)
 
umm u said at first u want a page source code ,
there is some methods tht u can gain the source code , with web browsers object u can ,or with :
VB.NET:
    Dim client As New Net.Sockets.TcpClient
    client.Connect("ur ip", 80)
    Dim writer As New IO.StreamWriter(client.GetStream)
    Dim reader As New IO.StreamReader(client.GetStream)
    writer.WriteLine("GET ur url")
    writer.WriteLine("Host: ur ip")
    writer.WriteLine()
    writer.Flush()
    Dim sb As New System.Text.StringBuilder
    While reader.Peek <> -1
        sb.AppendLine(reader.ReadLine)
    End While
    writer.Close()
    reader.Close()
    client.Close()
    MsgBox(sb.ToString)


Thanks dear for reply
but it return "bad request" in more sites !
and it didnt support coockie and i cant login with it in site :)
have u any good solution for me?
 
Back
Top