Solved

Culture settings for a console application.

Posted on 2007-03-24
1
1,759 Views
Last Modified: 2013-11-07
Hello,
I have a console application which runs on end-users pcs.
The problem that I am having is that I need the program to execute with certain "Culture" settings regardless of
how the local PC is configured.
Example. When the program generates a Decimal number, the decimal seperator might be a coma instead of a period. The date might be generated in DD-MM-YY instead of MM-DD-YY.

These values get sent to a remote server via XML and if they are not formated properly, things just don't work.

I thought I could configure something in app.config but I can't find anything.
0
Comment
Question by:sinner052397
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 29

Accepted Solution

by:
Gautham Janardhan earned 500 total points
ID: 18787367
System.Globalization.CultureInfo CultureInfo = new CultureInfo("en-GB");
                  CultureInfo.DateTimeFormat.FirstDayOfWeek = System.DayOfWeek.Saturday;
                  Thread.CurrentThread.CurrentCulture = CultureInfo;
                  
0

Featured Post

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question