zoukankan      html  css  js  c++  java
  • 关于Windows phone 7.1 IsolatedStorageFile问题

        private const string FolderName = "temp1/NewFolder";

            void MainPage_Loaded(object sender, RoutedEventArgs e)
            {
                using (IsolatedStorageFile file = IsolatedStorageFile.GetUserStoreForApplication())
                {
                    file.CreateDirectory(FolderName);
                    
                    string[] array = file.GetDirectoryNames("temp1/");
                }
            }

            在7.0版本当中,array.Length的值为1,但是在7.1版本中的array.Length为0,就是说在7.1当中获取不到数据。

        查到MSDN 示例如下:

      // Create directorie

       store.CreateDirectory("MyApp1");

      // Create subdirectorie under MyApp1.

      string subdirectory1 = Path.Combine("MyApp1", "SubDir1");

        store.CreateDirectory(subdirectory1);

      // Create a file in a subdirectory.

      IsolatedStorageFileStream subDirFile = store.CreateFile(Path.Combine(subdirectory1, "MyApp1A.txt"));

      subDirFile.Close();

      // Gather file information

      string searchpath = Path.Combine(subdirectory1, "*.*");

      string[] filesInSubDirs = store.GetFileNames(searchpath);

      // Find subdirectories within the MyApp1 // directory using the multi character '*' wildcard.

      string[] subDirectories = store.GetDirectoryNames(Path.Combine("MyApp1", "*"));

      其中使用到了Path类并且使用了Combine方法,继续查找Path,没有查到Combine方法。所以 在Windows phone 中不能够使用Path

      

      至于windows phone 7.1 如何让使用IdolatedStorageFile 仍在迷惑中。。。 如果你知道的话,请留言,分享是一种美德!!

  • 相关阅读:
    linux命令(14):ifup/ifdown/ip addr命令
    linux命令(13):kill/killall命令
    linux命令(12):ping命令
    linux命令(11):df命令
    linux命令(9):route命令
    npm安装node-sass报msbuild相关错误的解决办法
    'vue-cli-service' 不是内部或外部命令,也不是可运行的程序 或批处理文件。
    redis发布与订阅的实现
    设计模式-工厂模式
    设计模式的介绍
  • 原文地址:https://www.cnblogs.com/mokey/p/2262005.html
Copyright © 2011-2022 走看看