private void Form1_Load(object sender, EventArgs e) { ReadOnlyCollection<TimeZoneInfo> tzCollection; tzCollection = TimeZoneInfo.GetSystemTimeZones(); this.timeZoneList.DataSource = tzCollection; } private void OkButton_Click(object sender, EventArgs e) { TimeZoneInfo selectedTimeZone = (TimeZoneInfo) this.timeZoneList.SelectedItem; MessageBox.Show("You selected the " + selectedTimeZone.ToString() + " time zone."); }
枚举计算机上存在的时区
最新推荐文章于 2023-12-07 14:53:08 发布