如何:获取时区的.NET Framework 2.0 [英] How to: get time zones in .net framework 2.0

查看:165
本文介绍了如何:获取时区的.NET Framework 2.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要寻找能获取可用时区的方法。
使用.NET Framework 3.5我的方法做同样的,但我期待使用.NET Framework 2.0去取。
.NET Framework 3.5的具体code是如下:

I am looking for a method which can fetch available time zones.
Using .net framework 3.5 I got method to do the same, but I am looking to fetch it using .net framework 2.0.
.net framework 3.5 specific code is as follows;

Dim timeZones As ReadOnlyCollection(Of TimeZoneInfo) = TimeZoneInfo.GetSystemTimeZones()
For Each timeZoneInfo As TimeZoneInfo In timeZones
    Console.WriteLine("{0}", timeZoneInfo.DisplayName)
Next

在此先感谢任何形式的帮助。

Thanks in advance for any kind of help.

推荐答案

我相信这篇文章包含的兼容源.NET 2.0:

I believe this article contains the source that is compatible with .NET 2.0:

HTTP://www.$c$cproject.com/KB/ VB / TimeZoneInfo.aspx

如果你抓住他们的源代码,你可以看看他们是如何做到 GetTimeZones 方法,其时区类。

If you grab their source you can check out how they did GetTimeZones method for their TimeZone class.

这篇关于如何:获取时区的.NET Framework 2.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆