c# - 使用 XNA 游戏以试用模式进入 Marketplace

标签 c# windows-phone-7 xna

我想检测我的游戏是否处于试用模式并让用户去市场购买。

我编写的代码是 HERE

虽然他们提供的代码样本不起作用

if (Guide.IsTrialMode)
{
    Guide.ShowMarketplace(signedInGamer.PlayerIndex);
}

它给出 The name SignedInGamer doesn't exist in the current context

我试着玩了一下并将其修改为:

if (Guide.IsTrialMode)
{
   //Guide.ShowMarketplace(signedInGamer.PlayerIndex);
    Guide.ShowMarketplace(PlayerIndex.One);                
}

它现在可以工作,但在模拟器上它进入市场并提供:

enter image description here

我不确定是因为游戏处于 Debug模式还没有发布,还是因为我做了修改?!

最佳答案

这是因为它还没有在市场上发布。您链接到的页面有此注释:

When the method Guide.ShowMarketplace is called on an application that has not yet been published to the Windows Phone Marketplace, it will result in an error being displayed. If this error has the error code 805a0194, then the call was successful and will operate correctly when the application is published. When your application is published, the Guide.ShowMarketplace will automatically detect your application’s unique ID and launch the correct details page in the Windows Phone Marketplace client application.

关于c# - 使用 XNA 游戏以试用模式进入 Marketplace,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8824754/

相关文章:

c# - 无效的跨线程访问

c# - 你如何在c#中将图像旋转到鼠标的位置?

windows-phone-7 - 在 WP8 模拟器上运行 WP7.1 应用程序

silverlight - 覆盖 Silverlight 的 Internet Explorer 事件

c# - 使用XNA接入GPGPU进行图像处理

c# - 如何使用 GTK 使 Mono/C# 应用程序保留屏幕空间?

c# - 只返回一个对象的几个属性

c# - 具有预定偏移/旋转的分层 Sprite

c# - MVVM:如何避免将 DataContext 添加到 Xaml 以获得混合支持

c# - 为什么 LINQ to Entities 不能识别某些方法?