469,313 Members | 2,550 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,313 developers. It's quick & easy.

Reading data from a web server

I want to set some switches in say HTML, write the data to a file and
then read this file from a vb.et program. What is the best approach? I
thought at first maybe an RSS feed would do then I thought this was an
overkill since the data was more or less just 4 strings of true or
false each!
What would be the best approach? An XML file local on the server maybe
or a text file? How to read it remotely from my computer?

Thanks

k.
Jun 27 '08 #1
7 1042
Is something using System.Net.WebClient.DownloadFile() sufficient?

"kr*******@yahoo.co.uk" wrote:
I want to set some switches in say HTML, write the data to a file and
then read this file from a vb.et program. What is the best approach? I
thought at first maybe an RSS feed would do then I thought this was an
overkill since the data was more or less just 4 strings of true or
false each!
What would be the best approach? An XML file local on the server maybe
or a text file? How to read it remotely from my computer?

Thanks

k.
Jun 27 '08 #2
On May 9, 2:17 pm, Family Tree Mike
<FamilyTreeM...@discussions.microsoft.comwrote:
Is something using System.Net.WebClient.DownloadFile() sufficient?

"kronec...@yahoo.co.uk" wrote:
I want to set some switches in say HTML, write the data to a file and
then read this file from a vb.et program. What is the best approach? I
thought at first maybe an RSS feed would do then I thought this was an
overkill since the data was more or less just 4 strings of true or
false each!
What would be the best approach? An XML file local on the server maybe
or a text file? How to read it remotely from my computer?
Thanks
k.
Sounds promising. So the file could be a text file on the server ie
test_remote.txt say from a url

http://test.com/test_remote.txt

how to get this to a local file myfile_local.txt ?

K.
Jun 27 '08 #3
There are many possibilities, to get files from a server to a client,
however from where are you accessing it.

If it is a WindowsForm or WindowsService then the webclient.download is
probably the most simple one.

If it is a Webpage then simple adding a link on your page does it.

Cor

<kr*******@yahoo.co.ukschreef in bericht
news:1f**********************************@w8g2000p rd.googlegroups.com...
On May 9, 2:17 pm, Family Tree Mike
<FamilyTreeM...@discussions.microsoft.comwrote:
>Is something using System.Net.WebClient.DownloadFile() sufficient?

"kronec...@yahoo.co.uk" wrote:
I want to set some switches in say HTML, write the data to a file and
then read this file from a vb.et program. What is the best approach? I
thought at first maybe an RSS feed would do then I thought this was an
overkill since the data was more or less just 4 strings of true or
false each!
What would be the best approach? An XML file local on the server maybe
or a text file? How to read it remotely from my computer?
Thanks
k.

Sounds promising. So the file could be a text file on the server ie
test_remote.txt say from a url

http://test.com/test_remote.txt

how to get this to a local file myfile_local.txt ?

K.
Jun 27 '08 #4
On May 9, 1:51 am, kronec...@yahoo.co.uk wrote:
I want to set some switches in say HTML, write the data to a file and
then read this file from a vb.et program. What is the best approach? I
thought at first maybe an RSS feed would do then I thought this was an
overkill since the data was more or less just 4 strings of true or
false each!
What would be the best approach? An XML file local on the server maybe
or a text file? How to read it remotely from my computer?

Thanks

k.
Hi,
Take a look at System.Net.WebClient class that provides download /
upload related methods and functions both. Also My Namespace is
another choice, My.Comptuer.Network provides UploadFile, DownloadFile
that are suitable for any for including text format.

Thanks,

Onur Güzel
Jun 27 '08 #5
This should do it:

Dim wc As New System.Net.WebClient
Try
wc.DownloadFile("http://test.com/test_remote.txt", "c:\myfile_local.txt")
Catch ex As Exception
Console.Out.WriteLine("an error occurred retrieving data...")
End Try
"kr*******@yahoo.co.uk" wrote:
On May 9, 2:17 pm, Family Tree Mike
<FamilyTreeM...@discussions.microsoft.comwrote:
Is something using System.Net.WebClient.DownloadFile() sufficient?

"kronec...@yahoo.co.uk" wrote:
I want to set some switches in say HTML, write the data to a file and
then read this file from a vb.et program. What is the best approach? I
thought at first maybe an RSS feed would do then I thought this was an
overkill since the data was more or less just 4 strings of true or
false each!
What would be the best approach? An XML file local on the server maybe
or a text file? How to read it remotely from my computer?
Thanks
k.

Sounds promising. So the file could be a text file on the server ie
test_remote.txt say from a url

http://test.com/test_remote.txt

how to get this to a local file myfile_local.txt ?

K.
Jun 27 '08 #6
<kr*******@yahoo.co.ukschrieb:
What would be the best approach? An XML file local on the server maybe
or a text file? How to read it remotely from my computer?
In addition to the other replies:

'My.Computer.Network.DownloadFile'.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Jun 27 '08 #7
In addition to the other replies:

'My.Computer.Network.DownloadFile'.
In addition to this message: for versions later than 2003

:-)

Cor
Jun 27 '08 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by javastudent | last post: by
1 post views Thread by Boris Wilhelms | last post: by
21 posts views Thread by JoKur | last post: by
3 posts views Thread by Adman | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
1 post views Thread by Geralt96 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.