zoukankan      html  css  js  c++  java
  • 如何更改IsolatedStorage默认存储限额

    上次我们说到可以更改IsolatedStorage的默认存储限额,接下来我给大家介绍一下如何查看现在我们对IsolatedStorage的使用状况

    首先打开我们Silverlight配置页面(Silverlight Configuration):

    选择应用程序存储(Application Storage)选项卡:

    这下当前存储状态一目了然了吧~ 当然我也可以在程序中获取这些属性.

                using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForApplication())
                
    {
                    isf.AvailableFreeSpace.ToString() 
    + " bytes";//这里是剩余空间
                    isf.Quota.ToString() + " bytes";//这里是当前的限额
                    (isf.Quota - isf.AvailableFreeSpace).ToString() + " bytes";//这里是用户已经使用的空间
                  }

    好的 现在我们来看看如何更改默认限额吧~

                using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForApplication())
                
    {
                    
    try
                    
    {
                        
    if (true == isf.IncreaseQuotaTo(1048576 * 2))//将限额增加到2MB(注: 这里单位是bytes) 
                        {
                            Results.Text 
    = "限额更改成功.";
                        }

                        
    else
                        
    {
                            Results.Text 
    = "限额更改失败.";
                        }

                    }

                    
    catch (Exception e)
                    
    {
                        System.Windows.Browser.HtmlPage.Window.Alert(e.Message);
                    }

                }

    很简单吧~ 这里有的朋友要可能要问 上次存储我们那些数据放在哪啦

    就此告送大家应该在C:\Users\sonic\AppData\LocalLow\Microsoft\Silverlight\is\gsp5lhdk.hho\ulgnbrmt.oex\1\s\1q1n5d1w2fxymchxxzodpthfoihskwnyxxqcmkokboh55qcc3naaacga\f\sonic.txt

    Source code: IsolatedStorageDEMO2

  • 相关阅读:
    如何获取汉字对应的拼音
    php each()函数和list()函数
    php list()函数
    addslashes给预定义字符前面加上反斜杠
    array_filter() 过滤数组中的空白元素
    用.htaccess文件实现URL重写
    xml中实体引用
    onsubmit阻止表单提交
    php获取当前文件绝对路径
    array_merge() 函数的用法
  • 原文地址:https://www.cnblogs.com/sonic1abc/p/1246642.html
Copyright © 2011-2022 走看看