You can use "Application.CurrentCulture" to set these settings.
To keep it simple you can do it like :
Application.CurrentCulture = System.Globalization.CultureInfo.CreateSpecificCulture(new
System.Configuration.AppSettingsReader().GetValue("ur-PK",typeof(string)).ToString() );
Or if you want to parameterize it then you may use the following:
In the following snippet I have defined my culture settings in a config file. The tag goes like this :
add key="ApplicationCulture" value="ur-PK"
private void setCurrentCultureInfo(){
/// set ur culture information here.
Application.CurrentCulture = System.Globalization.CultureInfo.CreateSpecificCulture(new
System.Configuration.AppSettingsReader().GetValue("ApplicationCulture",typeof(string)).ToString() );
Application.CurrentCulture.DateTimeFormat = System.Globalization.DateTimeFormatInfo.CurrentInfo;
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment