检测 Windows Phone 7 的家乡 [英] Detecting home country of Windows Phone 7
问题描述
当我的应用程序在他们的手机上打开时,有没有办法以编程方式找出用户手机来自哪个国家?
Is there a way to programmatically find out what country a user's phone is from when my app is opened on their phone?
我正在开发一个可以使用 lbs/kg 单位的应用程序,如果某人的手机来自美国,我想默认启用 lbs,如果手机来自其他任何地方,我想默认显示kg.(请注意,我不需要认为检查他们从哪里连接是准确的,因为他们可能正在旅行或使用其他国家/地区的代理服务器).
I have an app I'm developing that can use lbs/kg units and if someone's phone is from the United States, I want to enable lbs by default and if the phone is from anywhere else, I want to display kg by default. (note that I don't need think checking where they are connecting from would be accurate because it could be that they are travelling or using another country's proxy server).
推荐答案
你猜不到国家,但你应该可以猜到:
You can't get the country, but you should be able to guess it from:
- 设备的区域设置 - 请参阅如何获取 "地区 &语言"通过代码在 WP7 中设置?
- 或从设备的时区 - 请参阅 TimeZoneInfo.Local - http://msdn.microsoft.com/en-us/library/system.timezoneinfo.local.aspx
就我个人而言,我不会担心旅行场景 - 购买您的应用的旅行美国人只占您下载量的很小一部分.
Personally, I wouldn't worry about the travelling scenario - travelling Americans purchasing your app represents a very small percentage of your downloads.
这篇关于检测 Windows Phone 7 的家乡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!