限制特定设备的 Windows Phone 应用程序 [英] restrict the windows phone app for specific devices

查看:33
本文介绍了限制特定设备的 Windows Phone 应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望我的应用程序可以在特定设备\操作系统上运行,例如Lumia 650"\windows phone 8",这是我的项目要求.

i want my application should work on specific devices\OS like "Lumia 650"\"windows phone 8", this is my project requirement.

有可能吗?如果是,我应该在哪里提及细节?

Is it possible ? if yes where should I mention the details ?

推荐答案

限制 Windows Phone 8 不是问题.您只需要针对 Windows Phone OS 8.0 构建它.对于设备模型,您可以在 App.xaml.cs

It is not a problem to restrict Windows Phone 8. You just need to build it targeting Windows Phone OS 8.0. For the device model you do something like this in the App.xaml.cs

    private void Application_Launching(object sender, LaunchingEventArgs e)
    {
        var deviceName = DeviceExtendedProperties.GetValue("DeviceName").ToString();
        if (!deviceName.Contains("Lumia_650")) // Please check your phone's actual value
            Application.Current.Terminate();
    }

如果您想在退出之前显示友好消息,您可以将代码移动到 MainPage.xaml.cs,然后添加 MessageBox.Show(message) 部分.

If you want to show a friendly message before it exits you can move the code to the MainPage.xaml.cs then add the MessageBox.Show(message) part.

这篇关于限制特定设备的 Windows Phone 应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆