Solved

Culture settings for a console application.

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
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 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 synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

932 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now