I have made a foolish mistake.
I installed .Net before setting my regional settings in XP and now DateTime.Now
will set the date as 12/01/2009 instead of 01/12/2009.
I'm sure there is an easy way to change this for the .Net runtime config but I 开发者_StackOverflowcan not remember what it is.
Change the Windows regional settings and it should be picked up automatically. At worst you might have to reboot. I don't believe the .NET-install-time regional settings are stored anywhere permanently.
For ASP.NET, I think you can use http://msdn.microsoft.com/en-us/library/bz9tc508.aspx
For WinForms and WPF application, I usually override Thread.CurrentThread.Culture and UICulture.
No neither of the above answers is correct.
The correct way to solve my problem was to amend the regional settings for my user account and then within the Registry export the Control Panel \ International key to a file. Then for each other user export the same key and overwrite the correct UK settings from the first (and correct reg key).
Once updated run each users settings back in to the registry and all is solved. The problem is to do with the regional settings applied to the ASPNET user created when installing DotNet.
精彩评论