User Tools

Site Tools


Action disabled: source
prog:csharp:250226-004:index

CHTCHSConv 使用C# 繁體轉簡體 (2025-02-26)

以下代碼演示了繁体及簡體中文字符串之間的轉換

  • using System;
    using Microsoft.International.Converters.TraditionalChineseToSimplifiedConverter;
    
    namespace Example_CS
    {
        class Program
        {
            static void Main(string[] args)
            {
                Console.WriteLine("The simplified format of 北京時間 is {0}.", ChineseConverter.Convert("北京時間", ChineseConversionDirection.TraditionalToSimplified));
                Console.WriteLine("The traditional format of 软件 is {0}.", ChineseConverter.Convert("软件", ChineseConversionDirection.SimplifiedToTraditional));
                Console.ReadLine();
            }
        }
    }
    
    /*
    This code produces the following output with Office12  Chinese edition installed:
    
    The simplified format of 北京時間 is 北京时间.
    The traditional format of 软件 is 軟體.
    This code produces the following output without Office12  Chinese edition installed:
    
    The simplified format of 北京時間 is 北京时间.
    The traditional format of 软件 is 軟件.*/
  • 4 person(s) visited this page until now.

prog/csharp/250226-004/index.txt · Last modified: 2025/02/26 13:00 (external edit)