转换英语月份名称为丹麦月份名称 [英] Convert English Month name into Danish month name

查看:122
本文介绍了转换英语月份名称为丹麦月份名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!

我有这个脚本,可以用英语月份的名称制作从1到12的月份下拉列表,我该如何用丹麦语名称对其进行硬编码?

Hi!

I have this script thats make a month dropdown list from 1 to 12 with the english month names, how can i hardcode it so its using danish names?

Dim dtfi As New DateTimeFormatInfo()
For month As Integer = 1 To 12
    Dim li As New ListItem()
    li.Text = dtfi.GetMonthName(month) & " (" & month.ToString() & ")"
    li.Value = month.ToString()
    dobm.Items.Add(li)
Next





Thank you all in advance.

推荐答案

Danish month名称可以作为array strings 获得,如下所示:
The Danish month names can be obtained as an array of strings as follows:
string[] monthNames = System.Globalization.CultureInfo.GetCultureInfo("da-DK").DateTimeFormat.MonthNames;

//monthNames content

//januar
//februar
//marts
//april
//maj
//juni
//juli
//august
//september
//oktober
//november
//december


这篇关于转换英语月份名称为丹麦月份名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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