争怎路由网:是一个主要分享无线路由器安装设置经验的网站,汇总WiFi常见问题的解决方法。

使用 .NET的IO(4) Paul_Ni(原作)

时间:2024/7/16作者:未知来源:争怎路由网人气:

IsolatedStorageScope.Assembly, null, null);

 }
}
枚举存储区
您可以使用 IsolatedStorageFile 静态方法 GetEnumerator 枚举当前用户的所有独立存储区。GetEnumerator 取 IsolatedStorageScope 值并返回 IsolatedStorageFile 枚举数。User 是唯一受支持的 IsolatedStorageScope 值。要枚举存储区,您必须具有指定 IsolatedStorageContainment 值 AdministerIsolatedStorageByUser的 IsolatedStorageFilePermission。当使用 IsolatedStorageScope 值 User 进行调用时,GetEnumerator 返回为当前用户定义的 IsolatedStorageFiles 数组。

EnumeratingStores 示例
下面的代码示例获得按用户和程序集隔离的存储区并创建几个文件。调用 GetEnumerator 方法并将结果放入 IEnumerator。然后代码依次通过 IEnumerator,添加文件的大小,并将结果报告给控制台。实际枚举发生在私有 EnumerateTheStore 方法中,为了清楚起见,将该方法与代码的其他部分分开,放在文件的底部。

[C#]
using System;
using System.IO;
using System.IO.IsolatedStorage;
using System.Collections;

public class EnumeratingStores{

 public static int Main(){

// Get an isolated store for this assembly and put it into an
// IsolatedStorageFile object.

IsolatedStorageFile isoStore =IsolatedStorageFile.GetStore(IsolatedStorageScope.User

关键词:运用 .NET的IO(4) Paul_Ni(原作)




Copyright © 2012-2018 争怎路由网(http://www.zhengzen.com) .All Rights Reserved 网站地图 友情链接

免责声明:本站资源均来自互联网收集 如有侵犯到您利益的地方请及时联系管理删除,敬请见谅!

QQ:1006262270   邮箱:kfyvi376850063@126.com   手机版