• 关于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 仍在迷惑中。。。 如果你知道的话,请留言,分享是一种美德!!

  • 相关阅读:
    04 SecurityContextHolder与SecurityContext说明
    03 spring security执行流程分析
    02 spring security 自定义用户认证流程
    01 spring security入门篇
    第三周进度
    第二周进度
    一维整数组所有子数组和的最大值
    初入园子,自我介绍
    密码登录源码(jsp+java+数据库)
    第一周总结
  • 原文地址:https://www.cnblogs.com/mokey/p/2262005.html
Copyright © 2020-2023  润新知