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

  • 相关阅读:
    ubuntu下pip的安装和使用
    跨域总结
    本地存储小结
    SVN
    appium整理文档
    appium python andiroid自动化文档整理笔记
    Python 接口测试(二)
    Python 接口测试(一)
    Python 接口测试(四)
    Python 接口测试(三)
  • 原文地址:https://www.cnblogs.com/sonic1abc/p/1246642.html
Copyright © 2011-2022 走看看