tags:

views:

790

answers:

3

In ASP.Net, I have an XML file (within my project) that I would like to deserialize. FileStream objects do not allow you to open a file via URL.

What is the easiest way to open the file so I can deserialize it?

+2  A: 

If the file is within your project you just need to get the physical location of the file. You can use Server.MapPath("/yourfile.txt") to get the phyical location and then open it with a filestream.

Bryant
A: 

I do not quite understand, do you mean that you would like to serve the file to the user? Or that in your server side code you need to get access to an XML file that resides on a different server? Or, c) none of the above?

Mark
+1  A: 

you can use the XmlDocument.Load(url) method which will load an XML Document from a URL

lomaxx