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

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

  • 相关阅读:
    C#中yield return用法
    vs生成命令和属性的宏
    开源的库RestSharp轻松消费Restful Service
    【C#】工具类-FTP操作封装类FTPHelper
    常见编码bug
    用Redis存储Tomcat集群的Session(转载)
    session转载
    pv,uv
    cookie读取设置name
    转载cookie理解
  • 原文地址:https://www.cnblogs.com/ediszhao/p/3984000.html
Copyright © 2011-2022 走看看