C#列举本机语言表
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
//
using System.Globalization;
namespace 列举语言表
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
this.comboBox1.ValueMember = "LCID";
this.comboBox1.DataSource = CultureInfo.GetCultures(CultureTypes.FrameworkCultures);
}
private void comboBox1_Format(object sender, ListControlConvertEventArgs e)
{
CultureInfo ci=(CultureInfo)(e.ListItem);
if (ci != null)
{
e.Value = String.Format("{0}:{1}",ci.IetfLanguageTag,ci.DisplayName);
}
}
}
}