目前我在Windows 10移动设备上运行了wp8应用程序,但是我得到了一些意想不到的结果,特别是与照片相关的任务。
这是效果不佳的事情:
//Initializations for photo chooser task
PhotoChooserTask photoChooserTask = new PhotoChooserTask();
photoChooserTask.Completed += new EventHandler<PhotoResult>(photoChooserTask_Completed);
...
//Starting the photo chooser
photoChooserTask.Show();
...
//Getting result from photo chooser
void photoChooserTask_Completed(object sender, PhotoResult e)
{
String photoPath = e.OriginalFileName;
}
这适用于安装在Windows Phone 8.1设备上的wp8应用程序,总是像:
photoPath = "C:\Data\Users\Public\Pictures\Camera Roll\WP_20170504_002.jpg"
但是在Windows 10设备上安装的同一个wp8应用程序中出现意外行为,有时会出现类似的情况:
photoPath = "C:\Data\Users\Public\Pictures\Camera Roll\WP_20170504_002.jpg"
但有时我会在同一台设备上获得以下内容:
photoPath = "C:\Data\Users\DefApps\AppData\{82D0A9BD-6D54-4321-880B-445007A2A1B4}\local\PlatformData\PhotoChooser-b001485c-f41b-4676-b655-7aacee3d8267.jpg"
//This is not the real name of the saved photo, then is going to be a big problem if you want to save the name into a database an later use it to read the photo again.
我在以下设备中对此进行测试: 诺基亚Lumia 520(windows phone 8.1操作系统) Microsoft Lumia 550(Windows 10移动操作系统)