?
Solved

>NET Download Data

Posted on 2004-08-17
3
Medium Priority
?
248 Views
Last Modified: 2010-05-18
I would kike to be able to download web pages or web daa such as

http://www.site.com/downlaod.php?id=3
or

http://www.site.com/pagte.htm
to a variable in my windoww form

 is there a way to do this using the HTTP Request or any other class in the .NET framework.

I am working in VB.net

Thanks
0
Comment
Question by:vazzyb
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 

Accepted Solution

by:
Laytons earned 500 total points
ID: 11818892
If you want to get you hands on the underlying HTML contained within the web page you could try something like this. You will need a reference to Microsoft.mshtml first.

Imports System.Net
Imports mshtml

            Dim objResponse As HttpWebResponse
            Dim strTarget As String = "http://www.site.com/pagte.htm"
            Dim objRequest As HttpWebRequest = HttpWebRequest.Create(strTarget)
            Dim objStream As Stream
            Dim objGetStream As StreamReader
            Dim encode As System.Text.Encoding = System.Text.Encoding.GetEncoding("utf-8")

            objResponse = objRequest.GetResponse()
            objStream = objResponse.GetResponseStream
            objGetStream = New StreamReader(objStream, encode)
            Dim read(256) As Char

            Dim count As Integer = objGetStream.Read(read, 0, 256)
            While count > 0
                Dim str As New String(read, 0, count)
                strSource &= str
                count = objGetStream.Read(read, 0, 256)
            End While

            objGetStream.Close()
            objResponse.Close()
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn different types of Android Layout and some basics of an Android App.
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Simple Linear Regression

718 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question