I’ve just stumbled over the method IsolatedStorageFile.GetFileNames(“searchPattern”).
Lets take the given code:
try
{
IsolatedStorageFile file = IsolatedStorageFile.GetUserStoreForApplication();
file.CreateFile(“test1.txt”).Close();
file.CreateFile(“test2.txt”).Close();
file.CreateFile(“test3.txt”).Close();
file.CreateFile(“test4.txt”).Close();
file.CreateFile(“test5.txt”).Close();
file.CreateFile(“leer1.txt”).Close();
file.CreateFile(“leer2.txt”).Close();
file.CreateFile(“leer3.txt”).Close();
file.CreateFile(“leer4.txt”).Close();
file.CreateFile(“leer5.txt”).Close();
string[] files = file.GetFileNames();
files = file.GetFileNames(“test*.txt”); //Returns 10 entries, instead of 5
}
catch (IsolatedStorageException ios)
{
}
This shows that GetFileNames with search patterns fails in CTP and current beta returning in the sample with 10 entries, instead of 5.
If you use the sample including a subfolder, the values returned are correct.
SO, forr now, beware using this method on the Isolated Storage base folder.
The post WP7 CTP and Beta bug: IsolatedStorageFile.GetFileNames("searchPattern”) appeared first on Windows Phone Development.