How to get Directory size in IsolatedStorage of Windows Phone 8 App
There is no API to get the total size of a specific directory in the isolated storage. Therefore, the only alternative you have is to browse the files and manually compute the total size.
Here is a sample implementation:
long total = 0;
using (var isolatedStorage = IsolatedStorageFile.GetUserStoreForApplication())
{
string folder = "folder/";
foreach (var fileName in isolatedStorage.GetFileNames(folder))
{
using (var file = isolatedStorage.OpenFile(folder + fileName, FileMode.Open))
{
total += file.Length;
}
}
}
MessageBox.Show(total + " bytes");
How to get Directory size in IsolatedStorage of Windows Phone 8 App的更多相关文章
- How to know the directory size in CENTOS 查看文件夹大小
Under any linux system, you want to use the command du. (Disk Usage) Common usage is : du -sh file(s ...
- 格式化一个文件的大小(size),或者说是格式化一个app的大小(size)
long number = 6243161; Formatter.formatFileSize(context, number): 需要导包,import android.text.format.Fo ...
- Windows Azure 配置Active Directory 主机(4)
步骤 6:设置在启动时加入域的虚拟机 若要创建其他在首次启动时加入域的虚拟机,请打开 Windows Azure PowerShell ISE,粘贴以下脚本,将占位符替换为您自己的值并运行该脚本. 若 ...
- [UWP]涨姿势UWP源码——IsolatedStorage
前一篇涨姿势UWP源码分析从数据源着手,解释了RSS feed的获取和解析,本篇则会就数据源的保存和读取进行举例. 和之前的Windows Runtime一样,UWP采用IsolatedStorage ...
- iPad 多任务 Spilt View & Size Class
iPad 多任务 Spilt View & Size Class 一.多任务简介 iOS 9 以后iPad新增了多任务的支持,主要形式有三种: Slide Over (侧边快捷打开) Spil ...
- Compress a Folder/Directory via Perl5
Compress a Folder/Directory via Perl5 tested in Windows, Mac OS X, Ubuntu16.04 #!/usr/bin/perl #压缩指定 ...
- Winbind authentication against active directory
Winbind authentication against active directory Description This tip will describe how to configure ...
- Oracle Directory文件夹的知识
在上一章介绍expdp/impdp时曾使用过DIRECTORY这个概念,以下再简单说明下DIRECTORY的点点滴滴. MOS上对DIRECTORY的解释(266875.1): (1).基于服务端 v ...
- Windows Server 2016-WinSer2016 Active Directory新增功能
Windows Server 2016 Active Directory 域服务 (AD DS)新增很多功能用来提升Active Directory域及组织环境安全等,并帮助他们面向云的部署或混合部署 ...
随机推荐
- Ubuntu 12.04 64bit 配置完android 5.0编译环境后出现“could not write bytes: Broken pipe.”而无法进入输入帐号密码的登陆界面
Ubuntu 12.04 64bit 配置完android 5.0编译环境后出现“could not write bytes: Broken pipe.”而无法进入输入帐号密码的登陆界面.上网问了问百 ...
- 标准I/O库之定位流
有三种方法定位标准I/O流. (1)ftell和fseek函数.这两个函数自V7以来就存在了,但是它们都假定文件的位置可以存放在一个长整型中. (2)ftello和fseeko函数.Single UN ...
- MVC - 基础
什么是MVC模式 传统的WebForm发展到如今出现不少的缺陷 比如为了解决Http的无状态 WebForm模式使用了ViewState来保存客户端和服务端数据 过量的使用则会造成页面臃肿不堪 大量服 ...
- Java编程最差代码
字符串连接误用 错误的写法: String s = ""; for (Person p : persons) { s += ", " + p.getName( ...
- ArcGIS中文件共享锁定数据溢出 这个方法不行,建议用gdb,不要用mdb
ArcGIS中文件共享锁定数据溢出 (2011-11-24 15:52:41) 转载▼ 标签: 杂谈 分类: GIS 文件共享锁定数溢出.(Error 3052)1. Access数据库,同时操作大量 ...
- string与StringBuilder之性能比较
知道“StringBuilder比string性能强”好多年了,近日无聊病发作,就把这两个家伙给动了手术: using System; using System.Text; namespace Con ...
- 发布GeoServer后预览提示下载wms文件
这是因为发布的图层有中文所导致的,只需修改tomcat的server.xml文件 <Connector port="8080" protocol="HTTP/1.1 ...
- JQ实现复选框的全选反选不选
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- TPL(Task Parallel Library)多线程、并发功能
The Task Parallel Library (TPL) is a set of public types and APIs in the System.Threading and System ...
- 如何重写EF DBContext 获取链接字符串的方法
public partial class byvarDBFirst: DbContext { //使用自定义连接串 private static string GetEFConnctionString ...