且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何以编程方式在 Windows Phone 8 中创建相册文件夹

更新时间:2023-02-10 22:52:34

这怎么可能."这只有在您有权访问 API 的/其他不公开的方式时才有可能,请查看 this 来自诺基亚的新闻报道,例如,它指出

"How is this possible." This is only possible if you have access to API's/other means that are not publicly available, look at this news report from Nokia for example, it states

开发人员正在与诺基亚合作开发一个版本针对最新的 Windows Phone 平台体验进行了适当优化.

The developers were working with Nokia to produce a version that is properly optimised for the latest Windows Phone platform experience.

这意味着 WhatsApp 开发人员可以访问一些我们不值得"的开发人员所没有的内部好东西.

This means that the WhatsApp developers had access to some of the internal goodies that we "unworthy" developers do not.

这是我能想到的唯一解释.那么,有可能吗?是的,但仅限于精英.

This is the only explanation I can think of. So, is it possible? Yes, but only for the elite.

在 WP8.1 中,您可以这样做:

In WP8.1 you could do this:

IReadOnlyList<StorageFolder> storageFolderList = await KnownFolders.PicturesLibrary.GetFoldersAsync();
if (storageFolderList.Where(x => x.Name == "FolderName").Count() == 0)
{
    StorageFolder folderCreationResult = await KnownFolders.PicturesLibrary.CreateFolderAsync("FolderName", CreationCollisionOption.ReplaceExisting);
    var messageDialog = new MessageDialog("FolderName has been created", "Folder Created");
    await messageDialog.ShowAsync();
}
else
{
    var messageDialog = new MessageDialog("FolderName already exists.", "Folder Exists");
    await messageDialog.ShowAsync(); 
}