HTML FIle Reader

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I would like to develop a program to read an HTML file
from any website. I have been trying the WIN32 API
Internet functions but can't quite get them to work.
There is an example in Knowledge Base (# 175474) that
works with URL's like www.myserver.com but doesn't work
with URL's like http://myserver.com.

Can anyone give me some clues??

Thanks.
 
Hi Anon,

Are you doing this in VB6 (or earlier) or VB.NET?

If it's in VB.NET, there are classes for doing what you want. Have a look
at System.Net and System.Web.

I can't help you with WinInet myself, but there may be some others later.
The vb.winapi is possibly the best place to ask, and, of course, if it's VB6
there are newsgroups specific to that version.

Regards,
Fergus
 
* said:
I would like to develop a program to read an HTML file
from any website. I have been trying the WIN32 API
Internet functions but can't quite get them to work.
There is an example in Knowledge Base (# 175474) that
works with URL's like www.myserver.com but doesn't work
with URL's like http://myserver.com.

Quick and Dirty:

\\\
Imports System.IO
Imports System.Net
..
..
..
Dim wrq As WebRequest = _
WebRequest.Create("http://stud3.tuwien.ac.at/~e0025861/index.html")
Dim wrp As WebResponse = wrq.GetResponse()
Dim sr As StreamReader = New StreamReader(wrp.GetResponseStream())
MessageBox.Show(sr.ReadToEnd())
///
 
Hi anonymous
I would like to develop a program to read an HTML file
from any website. I have been trying the WIN32 API
Internet functions but can't quite get them to work.
There is an example in Knowledge Base (# 175474) that
works with URL's like www.myserver.com but doesn't work
with URL's like http://myserver.com.
In addition to the other answers,

I would first take a look to the "webbrowser" class on msdn and especialy to
"system.net.webclient", I think the last will help you the most.

The first is a hell of a job to get it working the way you want it, the
second is a piece of cake.

I hope this helps a little bit?

Cor
 
Works great !! Thanks for the help.
-----Original Message-----


Quick and Dirty:

\\\
Imports System.IO
Imports System.Net
..
..
..
Dim wrq As WebRequest = _
WebRequest.Create ("http://stud3.tuwien.ac.at/~e0025861/index.html")
Dim wrp As WebResponse = wrq.GetResponse()
Dim sr As StreamReader = New StreamReader (wrp.GetResponseStream())
MessageBox.Show(sr.ReadToEnd())
///

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
.
 
Back
Top