How to get Windows UI language?

  • Thread starter Thread starter Mika M
  • Start date Start date
M

Mika M

Hi!

I need to know which language version of Windows user is using, how to
get it? In my case I need to know is Windows in english or finnish only.
 
Mika,

I don't know what (language) Windows version the user is using, however you
can find what is his setting for the culture to use.

System.Globalization.CultureInfo.CurrentCulture

or this one

http://msdn.microsoft.com/library/d...zationcultureinfoclasscurrentculturetopic.asp

(I thougth that the language version was just a version number)

However why do you need it? Normally all things should be done by the
globalization automaticly in Net.

I hope this helps you sofar,

Cor
 
In fact the problem in my case is reading CSV-file using OLEDB provider.
Some of the computers at my customer are using english version Win
XP or Win 2000 and others finnish version of these Windowses.

English version Windowses can't read CSV file because the field
separator is ";". I quickly solved this problem for english windowses in
my application that it checks the separator first, and if separator is
";" then application makes new file into temporary files replacing ";"
into "," - and uses it because it works fine. However when Windows is
finnish version, then separator ";" works directly, so temporary file is
not needed.

I should quickly solve this separator problem somehow that same
application could work both (all) Windows language versions. Any better
suggestions than check UI language?

--
Mika
Mika,

I don't know what (language) Windows version the user is using, however you
can find what is his setting for the culture to use.

System.Globalization.CultureInfo.CurrentCulture

or this one

http://msdn.microsoft.com/library/d...zationcultureinfoclasscurrentculturetopic.asp

(I thougth that the language version was just a version number)

However why do you need it? Normally all things should be done by the
globalization automaticly in Net.

I hope this helps you sofar,

Cor
 
Mika,

Good reason, I should have know this one, I see now that I showed you even
the wrong one.
Can you try this code. If you know that it is an CSV with a true comma.

\\\
Threading.Thread.CurrentThread.CurrentCulture = _
New Globalization.CultureInfo.InvariantCulture 'En-*'

'do your job with the CSV file with the comma

'And set the culture back with
Threading.Thread.CurrentThread.CurrentCulture = _
Globalization.CultureInfo.InstalledUICulture
///

I hope this helps,

Cor
 

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

Back
Top