Home All Groups Group Topic Archive Search About

opentext( url address )

Author
26 Nov 2006 3:57 PM
tommydnp
Hello,

I need to read a line in a textfile which is published on a website
address ( http://www.radiocontact.be/Live/onair2.txt ) so I can resolve
the playlist of a radiostation.

The problem is that the way I tried it doesn't work:

variable = opentext("http://www.radiocontact.be/Live/onair2.txt")

because it only works with file pathnames.

Does anyone know how to solve this problem?

Author
26 Nov 2006 5:35 PM
Ken Tucker [MVP]
Hi,

        You need to get a response stream to read in the file.

        Dim sr As New
IO.StreamReader(Net.WebRequest.Create("http://www.radiocontact.be/Live/onair2.txt ").GetResponse.GetResponseStream)
        Trace.WriteLine(sr.ReadToEnd)

Ken
-----------------------------------------
Show quoteHide quote
"tommydnp" wrote:

> Hello,
>
> I need to read a line in a textfile which is published on a website
> address ( http://www.radiocontact.be/Live/onair2.txt ) so I can resolve
> the playlist of a radiostation.
>
> The problem is that the way I tried it doesn't work:
>
> variable = opentext("http://www.radiocontact.be/Live/onair2.txt")
>
> because it only works with file pathnames.
>
> Does anyone know how to solve this problem?
>
Author
26 Nov 2006 7:15 PM
Herfried K. Wagner [MVP]
"tommydnp" <nospam@nospam.com> schrieb:
> I need to read a line in a textfile which is published on a website
> address ( http://www.radiocontact.be/Live/onair2.txt ) so I can resolve
> the playlist of a radiostation.
>
> The problem is that the way I tried it doesn't work:
>
> variable = opentext("http://www.radiocontact.be/Live/onair2.txt")
>
> because it only works with file pathnames.

Check out the first listing at this page:

<URL:http://dotnet.mvps.org/dotnet/code/net/#InternetLoadFile>

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://dotnet.mvps.org/dotnet/faqs/>