Questions tagged [currentculture]

a Thread property in the .NET System.Threading namespace or a CultureInfo property in the .NET System.Globalization namespace

CurrentCulture refers to either the Thread.CurrentCulture property in the .NET System.Threading namespace or the CultureInfo.CurrentCulture property in the .NET System.Globalization namespace.

In both cases, this property is used to get or set the System.Globalization.CultureInfo object that represents the culture of the current thread.

Resources

Related Tags

139 questions
1
vote
0 answers

Evaluating a comma separated Expression using DataTable.Compute in C#

I have an expression which contains numbers that are separated by , or ., i.e a number in the expression can be 2,3 or 2.3. I get values to generate the expression from the database where the values are stored in one of the above format. I have an…
Vini
  • 1,978
  • 8
  • 40
  • 82
1
vote
3 answers

Why doesn't IndexOf work with StringCompare?

I get this error string v = "aeiou"; foreach(int i in lokacija.Naziv) { if(v.indexOf(lokacija.Naziv[i], StringComparison.CurrentCultureIgnoreCase) = -1) s+=lokacija.Naziv[i]; } The error says "cannot convert from…
1
vote
1 answer

Current CultureName for if else or a switch?

I need for an if or switch statement the current name. I couldn't find a solution. This code doesn't work. if (Thread.CurrentThread.CurrentCulture == new CultureInfo("en")) { // EN (default) } if…
AxelS
  • 314
  • 1
  • 4
  • 11
1
vote
1 answer

c# datetime.parseexact string was not recognized as a valid datetime

Below code throws an exception on my local, but not on server. DateTime date = DateTime.ParseExact("01/06/2015", "dd/MM/yyyy", null); Like I said it works on the server, but it throws 'System.FormatException' on my local. I assume this might be a…
genki98
  • 680
  • 1
  • 11
  • 31
1
vote
1 answer

Can CultureInfo.CurrentCulture differ per application pool?

I'm having trouble with CultureInfo in our ASP.NET web application. Our web application returns a different culture, depending on which application pool it is in. In application pool A, it is en-US, but in application pool B, it's nl-BE. I'd like…
Peter
  • 13,733
  • 11
  • 75
  • 122
1
vote
0 answers

Is the CurrentThread culture in ASP.Net, MVC, WCF and Web API safe if you forget to set the culture first?

I have an application that appears to sometimes set the CurrentThread culture, and of course it implicitly uses that culture everywhere (String.Format(), DateTime.ToString() etc. etc.). It is not clear to me what happens with the culture in the…
Jacob Bruinsma
  • 1,087
  • 1
  • 10
  • 23
1
vote
1 answer

ASP.NET MVC CurrentCulture, from user or server?

Quick question that I couldn't find a clear answer on, if I get the CurrentCulture of a thread in an MVC application, is this the culture based on the user's browser/OS, or the culture that is set on the server? Thanks
NeedACar
  • 921
  • 2
  • 8
  • 27
1
vote
1 answer

How do I execute an MSpec specification in a specific Thread Culture?

I have a few specifications that test code performing culture-aware conversions. I want to set a defined culture for my tests so that I can hard-code the expected values without having to worry about the configured culture of the system running the…
Fabian Schmied
  • 3,885
  • 3
  • 30
  • 49
1
vote
3 answers

Get value from language specific resource file without changing the site language

I have several resource files, e.g. default.aspx.resx, default.aspx.nl.resx, default.aspx.en.resx Now when I'm on the Dutch domain the default.aspx.nl.resx is loaded. But now I want to access the value from default.aspx.en.resx and get the English…
Adam
  • 6,041
  • 36
  • 120
  • 208
1
vote
1 answer

Getting the current culture date pattern in XAML code

So in my (large) project, I've got a special date box that derives from a masked text box and thus has a "Format" property. It works by giving it a short date format, such as: Now at the start of the…
WPFNewbie Wannabe
  • 198
  • 1
  • 2
  • 8
1
vote
1 answer

generate alphabet from current culture

Possible Duplicate: Quickest way to enumerate the alphabet in C# Howto enumerate the LOCALIZED alphabet in C#? Is there any way in .net to generate the alphabet for the current culture? For example in English - ABCDE.... If the culture is…
amateur
  • 43,371
  • 65
  • 192
  • 320
1
vote
1 answer

Orchard CMS reseting the Culture

I recently watched the very useful orchard harvest video on localization and internationalization, by Piotr Szmyd I want to set the culture using this method, checking for a cookie public class CultureSelector : ICultureSelector { public…
Axe
  • 764
  • 6
  • 29
1
vote
2 answers

How set the culture for fileupload (input file) control in ASP.NET

I encounter problem when changing culture (language) on my website. In fact all the controls correctly change language. But only controls "asp: FileUpload" do not change. The text description is always the same ... Is it possible to force the…
1
vote
0 answers

CurrentThread.CurrentUICulture -how to set via excel VBA

CurrentThread.CurrentUICulture -through C# we can set this value, but is it possible to set this via VBA. in an xla file..
user1066231
  • 551
  • 1
  • 7
  • 27
1
vote
4 answers

Is the decimal precision in Convert.ToDouble(object) dependent on culture?

May be this is a very basic question, but I am really interested to know what really happens. For example if we do the following in c#: object obj = "330.1500249000119"; var val = Convert.ToDouble(obj); The val becomes: 330.15002490001189 The…
Baig
  • 1,489
  • 1
  • 25
  • 41