473,883 Members | 1,663 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to read operating system's current culture (regional settings)

adi
Hi
I'm using .NET Framework 1.1
My application needs to read the system's language settings.
How to do this?

Thanks.

Nov 22 '06 #1
4 29869
Hi Adi,

Use System.Threadin g.Thread.Curren tThread.Current Culture. This is the
culture your thread is running in.
System.Threadin g.Thread.Curren tThread.Current UICulture contains the
culture used for your resources files.
On Wed, 22 Nov 2006 12:58:35 +0100, adi <ad***********@ ikonsoft.rowrot e:
Hi
I'm using .NET Framework 1.1
My application needs to read the system's language settings.
How to do this?

Thanks.


--
Happy Coding!
Morten Wennevik [C# MVP]
Nov 22 '06 #2
adi
Thanks

To be more explicit, I need to read the settings that I can found in
Control Panel / Regional and Language Options / Regional Options
property tab.

Is there at least an API function to call?
Morten Wennevik a scris:
Hi Adi,

Use System.Threadin g.Thread.Curren tThread.Current Culture. This is the
culture your thread is running in.
System.Threadin g.Thread.Curren tThread.Current UICulture contains the
culture used for your resources files.
On Wed, 22 Nov 2006 12:58:35 +0100, adi <ad***********@ ikonsoft.rowrot e:
Hi
I'm using .NET Framework 1.1
My application needs to read the system's language settings.
How to do this?

Thanks.

--
Happy Coding!
Morten Wennevik [C# MVP]
Nov 22 '06 #3
All this is contained inside the CultureInfo.Dat eTimeFormat,
CultureInfo.Num berFormat etc.

You can also read system settings directly using the SystemInformati on
class or tap into WMI using the classes in System.Manageme nt /
System.Diagnost ics
On Wed, 22 Nov 2006 13:45:39 +0100, adi <ad***********@ ikonsoft.rowrot e:
Thanks

To be more explicit, I need to read the settings that I can found in
Control Panel / Regional and Language Options / Regional Options
property tab.

Is there at least an API function to call?
Morten Wennevik a scris:
>Hi Adi,

Use System.Threadin g.Thread.Curren tThread.Current Culture. This is the
culture your thread is running in.
System.Threadi ng.Thread.Curre ntThread.Curren tUICulture contains the
culture used for your resources files.
On Wed, 22 Nov 2006 12:58:35 +0100, adi <ad***********@ ikonsoft.ro>
wrote:
Hi
I'm using .NET Framework 1.1
My application needs to read the system's language settings.
How to do this?

Thanks.

--
Happy Coding!
Morten Wennevik [C# MVP]


--
Happy Coding!
Morten Wennevik [C# MVP]
Nov 22 '06 #4
Thanks guys,

I'll take the temp dir approach.

Cheers,

JB
Nov 22 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
15856
by: Jonathan | last post by:
Dear All, I am trying to set a webserver to use French regional settings for testing ASP pages. According to http://support.microsoft.com/kb/q306044, for IIS5, this is a matter of changing the regional settings for the authenticated user, and if this user does not have a user profile then the default regional settings. Unfortunately, this does not seem to be working in IIS6, in that I have
3
12412
by: Emmanuel | last post by:
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;
3
5263
by: Karunakararao | last post by:
Hi All, How can i get the date based on Regional settings . how can i get the date format using C# .NET " The date displayed in the date/time field should be formatted according to the regional settings made at the operating system level. For example, Canada uses a dd/mm/yyyy format while the US uses mm/dd/yyyy. The month and day should be padded with zeros. In other words, use 01/01/2005 rather than 1/1/2005. The date will...
2
6801
by: Karunakararao | last post by:
Hi All regional settings made at the operating system level. For example, Canada uses a dd/mm/yyyy format while the US uses mm/dd/yyyy. how can i get this type date format : iam using this code in C#: System.DateTime.UtcNow.Date.ToString(); Regards
0
1502
by: Karunakararao | last post by:
Hi Vinay I am not able to get the web application. regional settings made at the operating system level. For example, Canada uses a dd/mm/yyyy format while the US uses mm/dd/yyyy. and yyyy/mm/dd when i am changing the short date format in regional settings That is not effected . when i was change the like engilsh any other german it is effecting the date formats. how can i get this type date format :
12
9165
by: magister | last post by:
Hello, I know I can set the Culture to what I want, but shouldn't the current culture be taken from the regional settings on the web server's control panel!!! Mine is set to "united kingdom" but in my asp.net page I do
2
2347
by: Andy Pickering | last post by:
I made the mistake of leaving the regional settings as US (I'm based in the UK) when I installed my development server (2003 Std). I've set the regional settings back to English (UK) in all of the settings in control panel - but my sites are still showing the date formats as mm/dd/yyyy. I know I can add culture = "en-GB" to the globalization setting in web.config but I'd like to know how to sort this out on a system wide scale (just in...
9
3924
by: Edge | last post by:
hi, I am saving the user selected culture in a session variable so I can apply it back to all pages when refreshed and then load the proper .resx values. For that I am using global.asax
4
3050
by: Harold Crump | last post by:
Greetings, This is not strictly a ASP.NET question, but I am hoping someone can help. I have an ASP.NET web app that used the DateTime.Parse and Compare methods a lot. As expected, the Regional Settings/Culture on the server (Windows Server 2003), affects the behaviour of those DateTime functions (date
0
9936
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
11138
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10742
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10846
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10412
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9571
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7970
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7123
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5990
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.