摘要:(2010-08-13) C#.NET 全球化語系
全球化 => Culture(文化)-Locate(區域)
多語系系統 -zh-tw , zh-cht,en-us,en-gb
系統資源 fr-xxx
文字翻譯 使用 AsciiI XML
程式碼
1.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
namespace mod02
{
static class Program
{
/// <summary>
/// 應用程式的主要進入點。
/// </summary>
[STAThread]
static void Main()
{
//建構文化物件
System.Globalization.CultureInfo info = new System.Globalization.CultureInfo(1049);
//設定系統執行緒
System.Threading.Thread.CurrentThread.CurrentCulture = info;
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}2.
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;
namespace mod02
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
this.textBox1.Text = String.Format("{0:D}", DateTime.Now);
}
}
}