zoukankan      html  css  js  c++  java
  • wp8数据存储--独立存储文件 【转】

    出自 : http://www.cnblogs.com/MyBeN/p/3339019.html

    文章篇幅有点大,建议去源网看看

    1.调用手机的独立存储

      例如:IsolatedStorageFile storage = IsolatedStorageFile.GetUserStoreForApplication()

    2.创建独立存储文件流

      例如:IsolatedStorageFileStream location = new IsolatedStorageFileStream(nateText.Text + ".item", System.IO.FileMode.Create, storage);

    3.读写该文件流

      例如:将独立存储文件流转化为可写流

           System.IO.StreamWriter file = new System.IO.StreamWriter(location);

          将XML文件保存到流file上,即已经写入到手机独立存储文件上,_doc是用户创建的文件:

          _doc.Save(file);

          转化为可读流:

          System.IO.StreamReader file = new System.IO.StreamReader(location);

          解析流,转化为XML

          _xml = XElement.Parse(file.ReadToEnd());

    原作者有例子,由于篇幅过大,不方便复制。

  • 相关阅读:
    MySQL 通过多个示例学习索引
    git reset的用法
    git rebase的用法
    学习yii2.0——依赖注入
    学习yii2.0——行为
    学习yii2.0——事件
    学习yii2.0——数据验证
    让Apache和Nginx支持php-fpm模块
    安装python3
    使用php操作memcache
  • 原文地址:https://www.cnblogs.com/ediszhao/p/3984000.html
Copyright © 2011-2022 走看看