Advertisement
onzulin

application C# Metro Style

Jun 18th, 2012
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.03 KB | None | 0 0
  1.  private async void ButtonLoad_Click(object sender, RoutedEventArgs e)
  2.         {
  3.             /* he probado de todas las maneras posibles y no funciona con metodos page_loaded, LayoutRoot_Loaded eso es
  4.              *
  5.             StorageFolder folder = KnownFolders.DocumentsLibrary;
  6.             IReadOnlyList<StorageFile> files = await folder.GetFilesAsync();
  7.             foreach (StorageFile file in files)
  8.             {
  9.                 // Do something with file
  10.                 string path = file.Path;
  11.             }*/
  12.             StorageFolder storageFolder = KnownFolders.DocumentsLibrary;
  13.             IReadOnlyList<StorageFile> listFiles = await storageFolder.GetFilesAsync();
  14.             int countFiles = listFiles.Count;
  15.             int i = 0;
  16.             int indice = 0;
  17.             while (i < countFiles)
  18.             {
  19.                 StorageFile file = listFiles.ElementAt(indice);
  20.                 string path = file.Path;
  21.                 ListBoxFiles.Items.Add(path);
  22.                
  23.             }
  24.            
  25.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement