I want to create a Silverlight (Framework 4.0, C# and Visual Studio 2010) application that loads some XML configuration files from the local directory of the application. I need that the code loads all the files in a specific directory.
I’m not able to do it with System.IO Directory.GetFiles, how can I do that?
Silverlight code runs in a browser, and you can’t “open files locally” at will – when you come to it there are plenty of tutorials available when you search with
silverlight open fileon Bing.In your case, you seem to want to read files from a server where a Silverlight application is hosted. It is allowed by security restrictions, so make a web request to your origin and get the data. That is, use
WebClient.DownloadStringAsync– that is, see Silverlight FlickR Example (link provided by Alex Golesh @ in an MSDN forum post)