jeudi 27 août 2015

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 (Thread.CurrentThread.CurrentCulture == new CultureInfo("de"))
        {
            // DE
        }

Aucun commentaire:

Enregistrer un commentaire