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());

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

  • 相关阅读:
    第三方登录原理
    django-rest-framework之 json web token方式完成用户认证
    HTTP Basic Authentication认证
    python 创建虚拟环境
    scrapy pipeline
    beautifulsoup 安装
    scrapy 安装
    Jmeter 安装
    css中的行高line-height
    html块级元素与行内元素
  • 原文地址:https://www.cnblogs.com/ediszhao/p/3984000.html
Copyright © 2011-2022 走看看