FileOpenPicker.FileTypeFilter Proprietà

Definizione

Ottiene la raccolta di tipi di file visualizzati dalla selezione aperta dal file.

public:
 property IVector<Platform::String ^> ^ FileTypeFilter { IVector<Platform::String ^> ^ get(); };
IVector<winrt::hstring> FileTypeFilter();
public IList<string> FileTypeFilter { get; }
var iVector = fileOpenPicker.fileTypeFilter;
Public ReadOnly Property FileTypeFilter As IList(Of String)

Valore della proprietà

IVector<String>

IList<String>

IVector<Platform::String>

IVector<winrt::hstring>

Oggetto fileExtensionVector che contiene una raccolta di tipi di file (estensioni di file), ad esempio ".doc" e ".png". Usare . prima che l'estensione del file sia obbligatoria (ad esempio ".txt") a meno che non specifichi solo un carattere jolly "*". Vedere gli esempi di seguito. Le estensioni del nome file vengono archiviate in questa matrice come oggetti stringa .

Esempio

L'esempio selezione file illustra come specificare i tipi di file che l'utente può visualizzare e selezionare nella selezione file.

FileOpenPicker openPicker = new FileOpenPicker();
openPicker.ViewMode = PickerViewMode.Thumbnail;
openPicker.SuggestedStartLocation = PickerLocationId.PicturesLibrary;
openPicker.FileTypeFilter.Add(".jpg");
openPicker.FileTypeFilter.Add(".jpeg");
openPicker.FileTypeFilter.Add(".png");
FileOpenPicker openPicker = new FileOpenPicker();
openPicker.ViewMode = PickerViewMode.List;
openPicker.SuggestedStartLocation = PickerLocationId.DocumentsLibrary;
openPicker.FileTypeFilter.Add("*");

Si applica a

Vedi anche