Solved

Culture settings for a console application.

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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deleti…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

706 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

19 Experts available now in Live!

Get 1:1 Help Now