Windows Phone获得IsolatedStorage中指定目录下的所有文件

在Windows Phone 中对隔离存储空间中的文件操作需要通过System.Io.IsolatedStorage下的类进行操作

获得指定文件夹下的所有文件:

参数:是指定文件夹的路径加上通配符,格式:\folder1\*

        List<string> GetFileNames(string _strFolder)
        {
            List<string> returnlst = new List<string>();
            using (IsolatedStorageFile storage = IsolatedStorageFile.GetUserStoreForApplication())
            {
                returnlst.AddRange(storage.GetFileNames(_strFolder));
            }
            return returnlst;
        }
View Code

 如果想获得指定类型的,需要把文件后面的“ * ”换成指定格式的“ *.png ”,就可以获得指定文件夹下的所有png文件了

 

posted @ 2014-05-15 19:14  LetGo  阅读(237)  评论(0编辑  收藏  举报