Wednesday, 21 August 2013

Generating a list of file names from the current project from a silverlight application?

Generating a list of file names from the current project from a
silverlight application?

I'm having some trouble trying to get a list of files stored within a
folder that's stored within my Silverlight application client project. I'm
trying to collect a list of file names of images to dynamically create
URIs based on the files within that folder. All I need is a list of the
file names.
I've tried:
App.GetResourceStream(new Uri(PathName));
and this works fine for getting files I know the name of. But I haven't
found a way of returning a list of files yet.
My project is called TestWebsite The the files would be stored within
"TestWebsite\Images\ConceptArt\" and all the files will be of the same
image format e.i. '.jpg'
I have also tried this:
var result =
Directory.EnumerateFiles(@"C:\Users\UserName\Pictures\ConceptArt\",
"*.JPG");
but this needs access which seems more trouble than it's worth.

No comments:

Post a Comment