Solved

Culture settings for a console application.

Posted on 2007-03-24
1
1,749 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
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

679 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