原出處
主要用到System.Threading、System.Globalization、System.Resources這三個:
================== 範例 ==================
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Threading;
using System.Globalization;
using System.Resources;
namespace SystemLanguage
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
String strML = Thread.CurrentThread.CurrentUICulture.ToString();
switch (strML)
{
case "Zh-TW":
label1.Text = "台灣";
break;
case "zh-CN":
label1.Text = "中国";
break;
case "en-US":
label1.Text = "Eng";
break;
default:
label1.Text = "台灣";
break;
}
}
}
}
沒有留言:
張貼留言