Good approach to calling Urls remotely?

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
 
G

Guest

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

Members online

No members online now.

Forum statistics

Threads
474,433
Messages
2,571,683
Members
48,796
Latest member
Greg L.

Latest Threads

Top