-----------------------------------------------------------

New Message on BDOTNET

-----------------------------------------------------------
From: nitin_karan
Message 3 in Discussion

Hi Renjith,   I haven't found anything to do this, but you can get them from the 
registry.   using System;
using Microsoft.Win32;

public class Test
{
 public static void Main(string[] args)
 {
  using(RegistryKey hklmKey = Registry.LocalMachine)
  {
   using(RegistryKey zonesKey = hklmKey.OpenSubKey(
    @"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones") )
   {
    string[] keyNames = zonesKey.GetSubKeyNames();

    for(int i = 0; i < keyNames.Length; i++ )
    {
     using(RegistryKey zoneKey = zonesKey.OpenSubKey(
      keyNames[i]) )
     {
      Console.WriteLine(keyNames[i]);
      Console.WriteLine(zoneKey.GetValue("Display"));
      Console.WriteLine(zoneKey.GetValue("Std"));
      Console.WriteLine(zoneKey.GetValue("Dlt"));
      Console.WriteLine("-------------------");
     }
    }
   }
  }
 }
}

The keyName is a full name like "Central Standard Time",
Display is "(GMT -06:00) Central Time (US & Canada)",
Std is "Central Standard Time", Dlt is "Cental Daylight Time".

There's also other values like "Index" which is its position
in the list, "MapID" which is a grid location (36,27 for CST),
and "TZI" which is binary and I assume it's some sort of
struct value that Windows uses to represent TimeZones internally.

Also, on WinNT4, Win2K, and later, the reg key is "Windows NT"
as mentioned above, but on Win95/98/ME, it's just "Windows".

May be this could help you.   --Nitin

-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/bdotnet/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you received 
this message by mistake, please click the "Remove" link below. On the pre-addressed 
e-mail message that opens, simply click "Send". Your e-mail address will be deleted 
from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to