Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
DotNet
acad.assignment.mngr
academic
adonet
aspnet
aspnet.announcements
aspnet.build.controls
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
clr
compactframework
component_services
datatools
distributed_apps
drawing
faqs
framework
framework.wmi
general
internationalization
interop
languages.csharp
languages.jscript
languages.vb
languages.vb.controls
languages.vb.data
languages.vb.upgrade
languages.vc
languages.vc.libraries
myservices
odbcnet
performance
remoting
scripting
sdk
security
setup
vjsharp
vsa
webservi.enhancements
webservices
windowsforms
windowsforms.controls
winforms.databinding
winforms.designtime
xml
  
 
date: Fri, 25 Apr 2008 04:54:02 -0700,    group: microsoft.public.dotnet.internationalization        back       


Localization based Metric or Imperial , List separators in asp .Ne   
Can anyone please tell me how to use Localization based Metric or Imperial , 
List separators in asp .Net
date: Fri, 25 Apr 2008 04:54:02 -0700   author:   Akhil Jadhav

Re: Localization based Metric or Imperial , List separators in asp .Ne   
You can get the ListSeparator by

CultureInfo.CurrentCulture.TextInfo.ListSeparator

Note that you get Metric or Imperial by

RegionInfo.CurrentRegion.IsMetric

Also note on http://msdn.microsoft.com/en-us/library/system.globalization.regioninfo.aspx

"The value of this property is based on the culture selected through
the regional and language options portion of Control Panel. However,
that information can change during the life of the AppDomain. The
RegionInfo class does not automatically detect changes in the system
settings, but the CurrentRegion property is updated when you call the
ClearCachedData method."


Example:

        public void LocalizationListSeparator()
        {
            Thread.CurrentThread.CurrentCulture =
CultureInfo.GetCultureInfo("en-US");
            Console.WriteLine("CultureInfo:\t" +
CultureInfo.CurrentCulture.Name);
            Console.WriteLine("ListSeparator:\t" +
CultureInfo.CurrentCulture.TextInfo.ListSeparator);
            Console.WriteLine("RegionInfo:\t" +
RegionInfo.CurrentRegion.Name);
            Console.WriteLine("IsMetric:\t" +
RegionInfo.CurrentRegion.IsMetric);

            Thread.CurrentThread.CurrentCulture =
CultureInfo.GetCultureInfo("it-IT");
            Console.WriteLine("CultureInfo:\t" +
CultureInfo.CurrentCulture.Name);
            Console.WriteLine("ListSeparator:\t" +
CultureInfo.CurrentCulture.TextInfo.ListSeparator);
            Console.WriteLine("RegionInfo:\t" +
RegionInfo.CurrentRegion.Name);
            Console.WriteLine("IsMetric:\t" +
RegionInfo.CurrentRegion.IsMetric);
        }

Regards,
Joachim
date: Fri, 16 May 2008 08:09:52 -0700 (PDT)   author:   unknown

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us