Filter file lists to get specific type files

Ron

I got the following code to list files in videos library:

    var files = await Windows.Storage.KnownFolders.VideosLibrary.GetFilesAsync();
    foreach (StorageFile file in files)
    {
        textBox1.Text += file.Path + "\n";
    }

Can I filter the files to get only specific file type files such as mp4 files only?
I know I can filter by using "if condition" in the foreach loop - I believe there's better solution and that's why I ask here.

Thanks

Damith
var queryOptions = new QueryOptions(CommonFileQuery.DefaultQuery, new[] { ".mp4" });
queryOptions.FolderDepth = FolderDepth.Deep;
var query = Windows.Storage.KnownFolders.VideosLibrary.CreateFileQueryWithOptions(queryOptions);
var files = await query.GetFilesAsync();

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Python :: Changing lists in specific files

From Dev

How to show files from specific file type in CMD?

From Dev

List comprehension with if conditional to get list of files of a specific type

From Dev

Using jQuery to filter for specific nested unordered lists

From Dev

<input type="file"> showing first "All Files (*.*)" and not specific file type in Firefox

From Dev

How do I get audio files of a specific file size?

From Dev

ignore specific file when using glob to get folder files

From Dev

How to Filter by file type

From Dev

Get the default icon for specific file type in Ubuntu OS by python

From Dev

Get the default icon for specific file type in Ubuntu OS by python

From Java

Correctly ignore all files recursively under a specific folder except for a specific file type

From Dev

input type="file" - temp files deleted with post-redirect-get

From Dev

How to get text value of input type=file for multiple files?

From Dev

Get Specific Type of JComponent

From Dev

Get lists by reading file in Python

From Dev

Enumerating files of specific type in Windows

From Dev

Filter files based on file name

From Dev

TFS: List all unique files in all changesets and filter by file type and changeset date

From Dev

File system filter driver for specific file types

From Dev

Linq get specific item from list of lists

From Dev

Get specific file with glob

From Dev

get the type of Category filter control

From Dev

How to search multiple files of specific file type within Sublime Text 3

From Dev

Find all files of a given extension when a specific file type exists in another directory

From Dev

Bash/Shell script find all files including keyword and of specific file type

From Dev

How can I filter variables by a specific type

From Dev

XML PHP, filter out specific "type"

From Dev

LINQ reuse "where" filter on a specific type

From Dev

get files list in a specific subfolder

Related Related

  1. 1

    Python :: Changing lists in specific files

  2. 2

    How to show files from specific file type in CMD?

  3. 3

    List comprehension with if conditional to get list of files of a specific type

  4. 4

    Using jQuery to filter for specific nested unordered lists

  5. 5

    <input type="file"> showing first "All Files (*.*)" and not specific file type in Firefox

  6. 6

    How do I get audio files of a specific file size?

  7. 7

    ignore specific file when using glob to get folder files

  8. 8

    How to Filter by file type

  9. 9

    Get the default icon for specific file type in Ubuntu OS by python

  10. 10

    Get the default icon for specific file type in Ubuntu OS by python

  11. 11

    Correctly ignore all files recursively under a specific folder except for a specific file type

  12. 12

    input type="file" - temp files deleted with post-redirect-get

  13. 13

    How to get text value of input type=file for multiple files?

  14. 14

    Get Specific Type of JComponent

  15. 15

    Get lists by reading file in Python

  16. 16

    Enumerating files of specific type in Windows

  17. 17

    Filter files based on file name

  18. 18

    TFS: List all unique files in all changesets and filter by file type and changeset date

  19. 19

    File system filter driver for specific file types

  20. 20

    Linq get specific item from list of lists

  21. 21

    Get specific file with glob

  22. 22

    get the type of Category filter control

  23. 23

    How to search multiple files of specific file type within Sublime Text 3

  24. 24

    Find all files of a given extension when a specific file type exists in another directory

  25. 25

    Bash/Shell script find all files including keyword and of specific file type

  26. 26

    How can I filter variables by a specific type

  27. 27

    XML PHP, filter out specific "type"

  28. 28

    LINQ reuse "where" filter on a specific type

  29. 29

    get files list in a specific subfolder

HotTag

Archive