CultureInfo in .net
c#:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Globalization;
namespace CultureInformationCS
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Please select a Culture format [ie. en-US, es-ES]");
String Original = Console.ReadLine();
CultureInfo UserCulture = new CultureInfo(Original);
String[] Days = UserCulture.DateTimeFormat.DayNames;
foreach (String Day in Days)
{
Console.WriteLine("Day name for " + UserCulture.DisplayName + " " + Day);
}
Console.WriteLine("Please select a NEW Culture format [ie. en-US, es-ES]");
String Modified = Console.ReadLine();
CultureInfo ModifiedUserCulture = new CultureInfo(Modified);
String[] ModifiedDays = ModifiedUserCulture.DateTimeFormat.DayNames;
foreach (String Day in ModifiedDays)
{
Console.WriteLine("Day name for " + UserCulture.DisplayName + " " + Day);
}
Console.ReadLine();
}
}
}
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Globalization;
namespace CultureInformationCS
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Please select a Culture format [ie. en-US, es-ES]");
String Original = Console.ReadLine();
CultureInfo UserCulture = new CultureInfo(Original);
String[] Days = UserCulture.DateTimeFormat.DayNames;
foreach (String Day in Days)
{
Console.WriteLine("Day name for " + UserCulture.DisplayName + " " + Day);
}
Console.WriteLine("Please select a NEW Culture format [ie. en-US, es-ES]");
String Modified = Console.ReadLine();
CultureInfo ModifiedUserCulture = new CultureInfo(Modified);
String[] ModifiedDays = ModifiedUserCulture.DateTimeFormat.DayNames;
foreach (String Day in ModifiedDays)
{
Console.WriteLine("Day name for " + UserCulture.DisplayName + " " + Day);
}
Console.ReadLine();
}
}
}
vb.net:
Imports System.Threading
Imports System.Globalization
Module Module1
Sub Main()
Console.WriteLine("Please select a Culture format [ie. en-US, es-ES]")
Dim Original As String = Console.ReadLine()
Dim UserCulture As New CultureInfo(Original)
Dim Days As String() = UserCulture.DateTimeFormat.DayNames
For Each Day As String In Days
Console.WriteLine("Day name for " & UserCulture.DisplayName & " " & Day)
Next
Console.WriteLine("Please select a NEW Culture format [ie. en-US, es-ES]")
Dim Modified As String = Console.ReadLine()
Dim ModifiedUserCulture As New CultureInfo(Modified)
Dim ModifiedDays As String() = ModifiedUserCulture.DateTimeFormat.DayNames
For Each Day As String In ModifiedDays
Console.WriteLine("Day name for " & ModifiedUserCulture.DisplayName & " " & Day)
Next
Console.ReadLine()
End Sub
End Module
Imports System.Globalization
Module Module1
Sub Main()
Console.WriteLine("Please select a Culture format [ie. en-US, es-ES]")
Dim Original As String = Console.ReadLine()
Dim UserCulture As New CultureInfo(Original)
Dim Days As String() = UserCulture.DateTimeFormat.DayNames
For Each Day As String In Days
Console.WriteLine("Day name for " & UserCulture.DisplayName & " " & Day)
Next
Console.WriteLine("Please select a NEW Culture format [ie. en-US, es-ES]")
Dim Modified As String = Console.ReadLine()
Dim ModifiedUserCulture As New CultureInfo(Modified)
Dim ModifiedDays As String() = ModifiedUserCulture.DateTimeFormat.DayNames
For Each Day As String In ModifiedDays
Console.WriteLine("Day name for " & ModifiedUserCulture.DisplayName & " " & Day)
Next
Console.ReadLine()
End Sub
End Module