-1

How can I access the current CultureInfo in a Class? This is what I want to do in my class:

   if(!LoggedIn())
    {
        string culture = CultureInfo.Name.replace("-","_"); //here is the Problem
                                                            //I don't know how to access the current CultureInfo
        HttpContext.Current.Response.Redirect("/" + HttpContext.GetGlobalResourceObject("pages", "login_" + culture);
    }

Edit For Reopening: This is not a duplicate here I wanted to know how to access culture info from a class and its totally different from the question which simply asks how to know the cultureinfo

Ashkan Mobayen Khiabani
  • 33,575
  • 33
  • 102
  • 171

1 Answers1

1

You can try doing this for the current thread's culture:

CultureInfo currentCulture = Thread.CurrentThread.CurrentCulture;
bit
  • 4,407
  • 1
  • 28
  • 50