Solved

Culture settings for a console application.

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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
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.

626 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