|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
.NET Framework Ignores Regional Settings on WinXPThe changes I make on my regional settings are not applied to .NET Culture is allways en-US and never changes no matter what the system settings are. I installed my OS and Dev. tools with default US settings since I never needed any other regional settings. Now I need to change them but can't. Any ideas? Env: WinXP SP2 / .NET 1.1 SP1 Best Regards Where do you need the other cultures? Do you need to change it based on the
regional settings, or do you want to do it from code? -- Show quoteHide quoteCarsten Thomsen Enterprise Development with VS .NET, UML, AND MSF http://www.apress.com/book/bookDisplay.html?bID=105 Communities - http://community.integratedsolutions.dk "mirzas" <mirza.se***@gmail.com> wrote in message news:1128066304.182900.228960@g49g2000cwa.googlegroups.com... > Hi, > > The changes I make on my regional settings are not applied to .NET > > Culture is allways en-US and never changes no matter what the system > settings are. > > I installed my OS and Dev. tools with default US settings since I never > needed any other regional settings. > > Now I need to change them but can't. > > Any ideas? > > > Env: WinXP SP2 / .NET 1.1 SP1 > > > Best Regards > I need .NET framework to use the system settings.
...Currency symbol, decimal separator and other culture specific stuff. Hello mirzas,
m> I need .NET framework to use the system settings. m> ..Currency symbol, decimal separator and other culture specific m> stuff. U can change it programmatically See System.Globalization namespace and class CultureInfo. Moreover, read it http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vxoriGlobalizationLocalizationNamespaces.asp By the way u can download localized FW, it's avaible for the about 10 languages on the MS download site --- WBR, Michael Nemtsev :: blog: http://spaces.msn.com/members/laflour "At times one remains faithful to a cause only because its opponents do not cease to be insipid." (c) Friedrich Nietzsche No, I need .NET to respond when I change regional settings inside
control panel. After all, those are system wide settings. Why is it not aware of the system setting? Does Thread.CurrentThread.CurrentCulture return the system/user regional setting ? I must read whatever is set up in regional settings and use that. No configuration files. btw. GetSystemDefaultLCID returns 4122 which is the correct setting. Mirzas,
When formatting numbers, dates etc, your application will use the regional settings on teh current system. However, you need to use the proper formatting options wherever you need it. Say you want to format a number and have the currency symbol applied, simply use the "C" formatting string, like this: int numberToFormat = 345353; string formattedNumber = numberToFormat.ToString("C"); As I see it, it's a matter of using the correct formatting strinsg, which are locale aware. -- Show quoteHide quoteCarsten Thomsen Enterprise Development with VS .NET, UML, AND MSF http://www.apress.com/book/bookDisplay.html?bID=105 Communities - http://community.integratedsolutions.dk "mirzas" <mirza.se***@gmail.com> wrote in message news:1128093968.810830.125000@g49g2000cwa.googlegroups.com... > No, I need .NET to respond when I change regional settings inside > control panel. After all, those are system wide settings. > > Why is it not aware of the system setting? > Does Thread.CurrentThread.CurrentCulture return the system/user > regional setting ? > > I must read whatever is set up in regional settings and use that. No > configuration files. > > btw. GetSystemDefaultLCID returns 4122 which is the correct setting. > Thanks for the reply but...
Could you explain this to me then. while(true) { Console.WriteLine("Change your regional settings and press enter..."); Console.ReadLine(); Console.WriteLine("Settings: " + Thread.CurrentThread.CurrentCulture.Name); Console.WriteLine("DecimalSeparator: " + Thread.CurrentThread.CurrentUICulture.NumberFormat.NumberDecimalSeparator); Console.WriteLine("Currency: " + Thread.CurrentThread.CurrentCulture.NumberFormat.CurrencySymbol); } This code should print out the system setting ? but no... no matter what I set up it always shows en-US Thanks all, found an answer here
http://www.dotnet247.com/247reference/msgs/57/286777.aspx quote: The user and system locale settings have no impact on the CultureInfo.CurrentUICulture property.
Show quote
Hide quote
"mirzas" <mirza.se***@gmail.com> wrote in message Here's a good place to start:news:1128066304.182900.228960@g49g2000cwa.googlegroups.com... > Hi, > > The changes I make on my regional settings are not applied to .NET > > Culture is allways en-US and never changes no matter what the system > settings are. > > I installed my OS and Dev. tools with default US settings since I never > needed any other regional settings. > > Now I need to change them but can't. > > Any ideas? http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsent7/html/vxoriPlanningGlobalReadyApplications.asp Marc http://nomagichere.blogspot.com
Other interesting topics
Windows Service and shutdown/restart of server...
VS 2005 RC: "has encountered a problem" on deployment HOW to solve ... System.Net.WebException: Connection closed Not all images are loaded correctly Resources files Manifest Resources: format ClickOnce Deployment Manifest Issues BLOB Error Error during start of Windows Service... System.Web.Mail Vs. System.Net.Mail |
|||||||||||||||||||||||