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域及组织环境安全等,并帮助他们面向云的部署或混合部署 ...
随机推荐
- [React] React Fundamentals: Add-on ClassSet() for ClassName
To get the add-ons, use react-with-addons.js (and its minified counterpart) rather than the common r ...
- 开启、关闭数据库mysql
1.命令行 net start mysql net start mysql 2.点控制面板→管理→服务 招到mysql 3.找到安装目录下的bin目录
- 【转】BeagleBone Black USB一线通(3)
接上篇 BeagleBone Black 一线通(2) 五.vnc图形终端 虽然 BB-Black带有一个Micro-HDMI接口,不过那么名片不到的一个小板,连接到一个20来寸的显示器上,还是有些 ...
- 基于anyrtc的sdk实现直播连麦互动
基于anyrtc的sdk实现直播连麦互动 前言 1.由于粘贴了较大的代码,造成内容比较长,可能会花费您较长的时间. 2.项目里面没有做权限判断,所以如果发现有页面发生崩溃可能是权限没有打开,请打开权限 ...
- the second assignment of software testing
作业2期心得体会.第一期仍有未完成的项目,比如应该指定所读课题的范围,是关于哪个方面的. 作业项目一: 安装并使用CheckStyle/PMD与FindBug 现在网络上查找了一番发现checkSty ...
- redhat 6.4 双网卡绑定
linux系统配置 1.redhat 6.4 双网卡绑定 1)#ethtool eth* //在服务器网口接网线至笔记本,确定各网口的配置文件: 2)切换目录 #cd /etc/sysconfig/n ...
- commons-fileupload源码学习心得
commons-fileupload依赖于commons-io包. commons-fileupload的使用方法: 1.创建一个文件项目工厂类DiskFileItemFactory. D ...
- TCL 双引号和花括号的区别
用了很一段时间的Modelsim,用TCL脚本仿真,开始注意起来它,看了些资料,有一个问题始终让我很困惑,那就是花括号 的用法,今天Google了一下,觉得有一点豁然了,记录一下.为了不让自己的翻译影 ...
- java基础语法笔记
这段时间看了一些java,急了一些笔记,记下一遍以后复习用! 2016-07-24 15:12:40 java很多语法都跟C#类似,下面列举一些不同的地方******注意***** java中的系统方 ...
- react 学习之十月之思
学习新技术,最怕的莫过于自己抱着莫大的决心去学习,然发现没有学到东西,这是很可怕的事情,但是能坚持下去,一点一点的消化知识点,并且去理解它是什么?有什么用?该怎么去用?使用的时候需要注意些什么呢? 这 ...