Good approach to calling Urls remotely?

  • Thread starter Thread starter Jim Bancroft
  • Start date Start date
J

Jim Bancroft

Hi,

I'm porting a web app from VB6 to C#, and one of the things the old
application did was call a few outside web pages (using http) and act on the
response stream. Is there a reccomended way to remotely call a URL in .Net,
a framework class maybe that's best geared toward this? Thanks very much.

-Jim
 
WebClient client = new WebClient();
Stream instream = client.OpenRead(URI);
StreamReader reader = new StreamReader(instream);
Debug.Write(reader.ReadToEnd());

or

byte[] bytes = client.DownloadData(URI);
 

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