Solved

The fastest way to read a remote XML file

Posted on 2007-11-17
1
480 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
1 Comment
 
LVL 29

Accepted Solution

by:
Göran Andersson earned 500 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

914 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now