CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2010
    Location
    Stockholm, Sweden
    Posts
    1

    Question Different regional settings for a specific application

    Hi,

    I am working in different .NET development projects at the same time using my laptop.
    The different .NET applications that I am working with depends on different regional settings for them to work as expected. The different applications uses the current users regional settings to format numbers, currency and display text in local langauges correctly and so on.

    When I switch between the different projects I also have to change my regional settings for it to match the intended end-user platform to be able to test the application in a correct manner.

    For deployment we have added functionality within the installation of the applications to alter the regional settings through registry settings and this works OK, but I would like to be able to switch between different regional settings quickly when I switch between development projects (this occurs several times a day).

    Since the regional settings in XP which is my OS when developing are bound to the user I was wondering if there is a possibility to create a loader of sorts that before launching the application to change the regional settings only for this specific application?

    I have thought about creating a user for each regional settings/country specific application I use and use the runas command but I do not know if this will work?

    Does anyone 1) have a clue what I am rambling on about? 2) have a suggestion / solution for my problem?

    Thanks in advance!

  2. #2
    Join Date
    Mar 2004
    Location
    Prague, Czech Republic, EU
    Posts
    1,701

    Re: Different regional settings for a specific application

    You can simply change regional settings at runtime without affecting the OS setting
    Code:
    Thread.CurrentThread.CurrentUICulture = New CultureInfo("ja-JP")
    Look at Thread and CultureInfo classes in MSDN.
    • Make it run.
    • Make it right.
    • Make it fast.

    Don't hesitate to rate my post.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured