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域及组织环境安全等,并帮助他们面向云的部署或混合部署 ...
随机推荐
- 前端JS开发框架-DHTMLX--dhtmlXTree
介绍 dhtmlxTree是一个功能丰富的JavaScript树菜单 它允许您快速添加一个好看的,基于ajax的web页面的分层树. treeview支持在线节点编辑.先进的拖放,三态复选框等等.由 ...
- JVM专题
http://blog.csdn.net/ITer_ZC/article/category/2758863
- oc中的类学习笔记1
1.oc中的类和构造方法 NSAutoreleasePool * pool =[[NSAutoreleasePool alloc] init]; NSAutoreleasePool是一个类,alloc ...
- linux使用过程中遇到的问题和解决方法
测试过程中,出现以下错误,导致远程ssh连接不上,最终导致测试结果失败.系统日志如下: Sep 1 03:15:03 node3 avahi-daemon[5834]: Invalid respo ...
- 【转】文件中有10G个整数,乱序排列,要求找出中位数
题目:在一个文件中有 10G 个整数,乱序排列,要求找出中位数.内存限制为 2G.只写出思路即可(内存限制为 2G的意思就是,可以使用2G的空间来运行程序,而不考虑这台机器上的其他软件的占用内存). ...
- hysdk代码解析
navigator 1. navigator.userAgent 浏览器的用户代理字符串 2. navigator.platform 浏览器所在的系统平台 window 1. window.devic ...
- 编译LFS
成功编译并运行linux from scratch 7.7 system,有必要作下总结.本次用的编译LFS的环境是: 虚拟机是virtalbox宿主系统为CentOS 7.0 x86_64 (cor ...
- 使用的 SQL Server 版本不支持数据类型“datetime2”解决办法
不论下方提示什么数据格式有错误,一般都是entity生成的时候的问题.比如服务器上用的sql2005,自己用的2008. 解决方法: model层生成的model.edmx文件,用记事本打开, 将&l ...
- H5 canvas 小demo之小球的随机运动
1:结构之html----balls.html <!DOCTYPE html> <html> <head lang="en"> <meta ...
- MySQL5.7.12新密码登录方式及密码策略
在Centos6.6上安装MySQL5.7.12时,遇到了一个问题 安装后在/root目录下没有发现有.mysql_secret这个文件,所以没有没法按照官方文档上说的那样使用,这里记录下, 解决方式 ...