Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
I am trying to create a stream of a source of a website. I do not get the same source as I would if I visited the same link simply by using IE. instead I get a message that my browser is not allowed. How do I report which browser I am using?
  • Leaders
Posted

i'm not sure what method you are trying to use, so i'll post this quick example i knocked up to see if it helps...

       Dim wc As New Net.WebClient()
       Try
           With wc
               Dim sReader As New IO.StreamReader(.OpenRead("http://www.xtremedotnettalk.com/t75697.html"))
               RichTextBox1.AppendText(sReader.ReadToEnd)
               sReader.BaseStream.Flush()
               sReader.Close()
               sReader = Nothing
           End With
       Catch ex As Exception
           MessageBox.Show(ex.Message)
       End Try

  • *Experts*
Posted
What site are you trying to access, leontager?

"Being grown up isn't half as fun as growing up

These are the best days of our lives"

-The Ataris, In This Diary

Posted (edited)

Dim stream As IO.StreamReader

Dim wc As New Net.WebClient()

stream = New IO.StreamReader(wc.OpenRead("URL"))

RichTextBox1.Text = stream.ReadToEnd

 

This is what I am doing. I am just wondering how to tell the server on their side that you are using either explorer or netscape or opera.

 

 

edit: example of this would be something like http://ricelawn.freemethodistchurch.org/browserchek.html

 

how can I make it display internet explorer instead of 5.0 (Windows; en-US) :)

Edited by leontager

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...