[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

The fastest way to read a remote XML file

Posted on 2007-11-17
1
Medium Priority
?
490 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

650 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