How will i identify the country name, from where an application is browse? [Resolved]

Posted by Mahe under Others on 1/29/2013 | Points: 10 | Views : 904 | Status : [Member] | Replies : 3
Hi All,

How will i identify the country name, from where an application is browse?

Thanks & Regards,
Mahe




Responses

Posted by: San.Pblr.Gct on: 1/30/2013 [Member] Starter | Points: 50

Up
0
Down

Resolved
It shows the country which you have set in Regional settings in control panel

Mahe, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: San.Pblr.Gct on: 1/29/2013 [Member] Starter | Points: 25

Up
0
Down
using System.Globalization;
...
// returns "language (country)" e.g. English (Canada), so do a substring
string culture = CultureInfo.CurrentCulture.EnglishName;
string country = culture.Substring(culture.IndexOf('(') + 1, culture.LastIndexOf(')') - culture.IndexOf('(')-1);

Mahe, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Mahe on: 1/30/2013 [Member] Starter | Points: 25

Up
0
Down
Thanks,

But it shows "United States" when i browse from "India", I think it shows the country name where server is placed.
Can i get the country name, of my current location rather than depended on the server location.


Thanks&Regards,
Mahe

Mahe, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response