How do I read user's regional settings ?

E

Emmanuel

I want to know the decimal separator and the group separator character
that the user has set in Regional Settings in Control Panel.

I tryied to use System.Globalization.NumberFormatInfo.CurrentInfo like
that:

NumberFormatInfo numInfo =
System.Globalization.NumberFormatInfo.CurrentInfo;
string ds = numInfo.CurrencyDecimalSeparator;
string gs = numInfo.CurrencyGroupSeparator;

These properties do not contain the values that the user has selected
from the "Regional Settings" but the proper values for the current
language.

This means that if the user has selected: "English (United Kindom)"
from the "Regional Settings" and then has changed the values of
separators using the "Customize" button, the above code will return
the proper separators for "English (United Kindom)" and not the custom
ones.

How can I read the separators that the user has selected from regional
settings ?


Thanks

Emmanuel
 
M

Marc Scheuner [MVP ADSI]

How can I read the separators that the user has selected from regional
settings ?

Have a look at the CurrentCulture property - it should give you access
to all the settings you're interested in. It will be initialized to
whatever the user has defined in his regional settings (as far as I
can tell).

Marc

================================================================
Marc Scheuner May The Source Be With You!
Bern, Switzerland m.scheuner(at)inova.ch
 
E

Emmanuel Tzevelekakis

Thank you Marc, but unfortunatelly it doesn't. It returns the default
settings for the current culture and not the user customized settings.

Any other ideas ?

Emmanuel
 
M

Marc Scheuner [MVP ADSI]

Thank you Marc, but unfortunatelly it doesn't. It returns the default
settings for the current culture and not the user customized settings.

Any other ideas ?

There's also a CurrentUICulture - not sure if that might work.

Marc
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top