VB.net - Openfilepicker 在 windows 移动 10 应用程序中不起作用

VB.net - Openfilepicker does not work in windows mobile 10 app

我正在开发 Windows 10 UWP 和这段代码:

Dim wopk As FileOpenPicker = New FileOpenPicker
With wopk
 .ViewMode = PickerViewMode.List
 .SuggestedStartLocation = PickerLocationId.DocumentsLibrary
 .FileTypeFilter.Add(".txt")
 dim wfile = Await .PickSingleFileAsync()
End with

我的 Lumia 535(Windows 移动 10)崩溃,没有错误消息(调试和运行时模式)。

出现启动画面但仍然挂起。

在桌面上一切正常。

在包清单声明中,我为文件 Open/Save Picker 定义了“.txt”扩展名。

该项目的目标 "Windows 10" 和版本 "Build 10586"。

这是我很快写的东西,它应该允许你访问openfilepicker
它不完整,但它应该引导你朝着正确的方向前进。

Imports Windows.Storage.Pickers
Public NotInheritable Class MainPage
Inherits Page

Private Async Sub button_Click(sender As Object, e As RoutedEventArgs) Handles button.Click
    Dim openfilepicker = New FileOpenPicker
    openfilepicker.SuggestedStartLocation = PickerLocationId.DocumentsLibrary
    openfilepicker.FileTypeFilter.Add(".txt")
    openfilepicker.CommitButtonText = "Open"

    Dim Textfile = Await openfilepicker.PickSingleFileAsync()
    If Textfile IsNot Nothing Then
        Dim SelectedTextFile = Await Textfile.OpenAsync(Windows.Storage.FileAccessMode.ReadWrite)
        'Write your code here using SelectedTextFile as the source for the async.
    End If

End Sub
End Class


如果您有任何问题,我会尽力帮助您,但是根据您的问题所述,这应该绰绰有余。
编码愉快!