Reputation: 4960
I'm trying to grab my files from isolated storage but unfortunatly it is pulling in all the files not just the specified ones from the pattern.
I'm using:
foreach (string fileName in storage.GetFileNames("*.item"))
Is this a known bug or am I just doing something wrong?
PS. The use of wildcards is essential
Any help very much apprieciated,
Thanks!
Upvotes: 0
Views: 1065
Reputation: 113
This API bug has been fixed in the release of the Windows Phone 7.1 SDK (Otherwise known as the "Mango" release).
Your code will work fine now.
Upvotes: 0
Reputation: 14882
This is a known issue. You'll need to either structure your files into folders if you want to limit what's retrieved or test/filter the filenames before loading them.
Upvotes: 1
Reputation: 3763
There is a IsolatedStorage search pattern bug in the final SDK release. Have a look at this post - http://blogs.compactframework.de/Peter.Nowak/2010/09/18/WP7+Final+SDK+Bug+IsolatedStorageFile+And+Ldquosearchpatternrdquo+And+A+Fix.aspx
HTH, indyfromoz
Upvotes: 1
Reputation: 11661
Looks like a bug in the CTP/Beta versions of IsolatedStorageFile.GetFileNames(string pattern)...
Upvotes: 0
Reputation: 2881
I'm not sure why it is not working. But you can try this one as well:
storage.GetFileNames().Select(fileName => fileName.EndsWith("item"));
Upvotes: 2