Reading data from a web server

  • Thread starter Thread starter kronecker
  • Start date Start date
K

kronecker

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.
 
Is something using System.Net.WebClient.DownloadFile() sufficient?
 
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
 
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
 
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
 
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'.
 
In addition to the other replies:

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

:-)

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top