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

mac2022-06-30  23

在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文件了

 

转载于:https://www.cnblogs.com/LeeYZ/p/3730656.html

最新回复(0)