?
Solved

The fastest way to read a remote XML file

Posted on 2007-11-17
1
Medium Priority
?
487 Views
Last Modified: 2013-12-17
Hi,

What would be the fastest and most efficient way to read a remote XML file (http://...) from my C# desktop application.

Please advise.
0
Comment
Question by:EEssam
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 29

Accepted Solution

by:
Göran Andersson earned 2000 total points
ID: 20305708
You can use the WebClient class:

string address = "http://www.somedomain.com/somefile.xml";
System.Net.WebClient client = new System.Net.WebClient ();
string reply = client.DownloadString (address);

You can use the DownloadStringAsync method instead, if you don't want the call to wait for the file to download. That way your program will not be unresponsive while the file is downloaded. The DownloadStringCompleted event will be triggered when the download is complete.
0

Featured Post

Linux Academy Android App Now Supports Chromecast

We have some fantastic news for our Android fans. We’re so excited to announce that the Linux Academy Android app is now available with Chromecast support. That’s right – simply download the latest update of the Linux Academy App and start casting your favorite course videos!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question