Windows 8 Windows 8许可证信息
我有一个Windows 8应用程序,我想现在就放在商店里。AppSimulator工作正常(尽管我在单击“确定”时无法将IsActive设置为“true”……但会弹出MsgDialog“谢谢”),但我不知道当前应用是否正确。我已经读到IsActive将自动设置为true,而不在代码中分配它 关于下面的代码,我有两个问题:Windows 8 Windows 8许可证信息,windows-8,licensing,windows-store-apps,Windows 8,Licensing,Windows Store Apps,我有一个Windows 8应用程序,我想现在就放在商店里。AppSimulator工作正常(尽管我在单击“确定”时无法将IsActive设置为“true”……但会弹出MsgDialog“谢谢”),但我不知道当前应用是否正确。我已经读到IsActive将自动设置为true,而不在代码中分配它 关于下面的代码,我有两个问题: CurrentApp的代码是否有效 当涉及CurrentApp时,我没有在WindowsStoreProxy.xml中分配任何内容,因为Windows正在从应用商店自动加载此信
#如果调试
StorageFolder proxyDataFolder=Wait Package.Current.InstalledLocation.GetFolderAsync(“数据”);
StorageFile proxyFile=等待proxyDataFolder.GetFileAsync(“in-app purchase.xml”);
licenseChangeHandler=新的LicenseChangeEventHandler(在应用程序购买刷新场景中);
CurrentAppSimulator.LicenseInformation.LicenseChanged+=licenseChangeHandler;
等待CurrentAppSimulator.ReloadSimulatorAsync(proxyFile);
#恩迪夫
#如果调试
LicenseInformation LicenseInformation=CurrentAppSimulator.LicenseInformation;
ListingInformation productListing=等待CurrentAppSimulator.LoadListingInformation同步();
#否则
LicenseInformation LicenseInformation=CurrentApp.LicenseInformation;
ListingInformation productListing=等待CurrentApp.LoadListingInformation同步();
#恩迪夫
ProductLicense ProductLicense=licenseInformation.ProductLicenses[“Premium”];
如果(!productLicense.IsActive)
{
购买
}
其他的
{
//使用全功能
}
私有异步void Buy()
{
#如果调试
LicenseInformation LicenseInformation=CurrentAppSimulator.LicenseInformation;
#否则
LicenseInformation LicenseInformation=CurrentApp.LicenseInformation;
#恩迪夫
如果(!licenseInformation.ProductLicenses[“Premium”].IsActive)
{
尝试
{
#如果调试
等待CurrentAppSimulator.RequestProductPurchaseAsync(“高级”,false);
#否则
等待CurrentApp.RequestProductPurchaseAsync(“高级”,false);
#恩迪夫
if(licenseInformation.ProductLicenses[“Premium”].IsActive)
{
尝试
{
MessageDialog msgDialog=newmessagedialog(“感谢您购买该应用程序”);
等待msgDialog.ShowAsync();
}
抓住
{
}
}
其他的
{
MessageDialog msgDialog=新建MessageDialog(“购买已取消”);
等待msgDialog.ShowAsync();
}
}
抓住
{
MessageDialog msgDialog=新建MessageDialog(“连接错误”);
msgDialog.ShowAsync();
}
}
其他的
{
MessageDialog msgDialog=newmessagedialog(“您已经拥有此功能”);
等待msgDialog.ShowAsync();
}
}
您无需通过代码进行设置。CurrentAppSimulator自动执行此操作
只需检查WindowsStoreProxy.xml中的设置,并确保“IsTrial”设置为“false”-
真的
假的
假的