FileOpenPicker.FileTypeFilter Properti

Definisi

Mendapatkan kumpulan jenis file yang ditampilkan pemilih buka 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)

Nilai Properti

IVector<String>

IList<String>

IVector<Platform::String>

IVector<winrt::hstring>

Objek fileExtensionVector yang berisi kumpulan jenis file (ekstensi nama file) , seperti ".doc" dan ".png". Penggunaan . sebelum ekstensi file diperlukan (misalnya ".txt") kecuali hanya menentukan kartubebas "*". Lihat contoh di bawah. Ekstensi nama file disimpan dalam array ini sebagai objek string .

Contoh

Sampel Pemilih file menunjukkan cara menentukan jenis file yang dapat dilihat dan dipilih pengguna di pemilih 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("*");

Berlaku untuk

Lihat juga