2 3 Microsoft.International.Converters.TraditionalChineseTo

时间:2021-12-20 07:58:30

Visual Studio International Pack 包罗一组类库,该类库扩展了.NET Framework对全球化软件开发的撑持。使用该类库供给的类,.NET 开发人员可以更便利的创建撑持多文化多语言的软件应用

下载地点:下载地点

 

(1) (ChnCharInfo.dll)

Simplified Chinese Pin-Yin Conversion Library

- 撑持获取简体中文字符的常用属性好比拼音,多音字,同音字,笔画数。

 

【例如:】

1 Microsoft.International.Converters.PinYinConverter.ChineseChar cc=new Microsoft.International.Converters.PinYinConverter.ChineseChar(‘国‘);

 

 

(2)(ChineseConverter.dll)

Traditional Chinese to Simplified Chinese Conversion Library and Add-In Tool

- 撑持简繁体中文之间的转换。该组件还包罗一个Visual Studio集成开发环境中的插件(Add-in)撑持简繁体中文资源文件之间的转换。

 

【例如:】

--简体转换为繁体字

1 string temp_1 = Microsoft.International.Converters.TraditionalChineseToSimplifiedConverter.ChineseConverter.Convert("*", 2 3 Microsoft.International.Converters.TraditionalChineseToSimplifiedConverter.ChineseConversionDirection.SimplifiedToTraditional);

 

--繁体字转换为简体

1 string temp_2 = Microsoft.International.Converters.TraditionalChineseToSimplifiedConverter.ChineseConverter.Convert(temp_1, 2 3 Microsoft.International.Converters.TraditionalChineseToSimplifiedConverter.ChineseConversionDirection.TraditionalToSimplified);

 

 

(3)(EastAsiaNumericFormatter.dll)

East Asia Numeric Formatting Library - 撑持将小写的数字字符串格局化成简体中文,,繁体中文,日文和韩文的大写数字字符串。

【例如:】

--将数字转换为大写简体中文(拾贰亿叁仟肆佰伍拾陆万柒仟捌佰玖拾点肆伍)

 

1 1 string temp_4 = string.Format(new Microsoft.International.Formatters.EastAsiaNumericFormatter(), "{0:L}", 1234567890.45);

 

--将数字转换为小写(十二亿三千四百五十六万七千八百九十点四五)

 

1 string temp_6 = string.Format(new Microsoft.International.Formatters.EastAsiaNumericFormatter(), "{0:Ln}", 1234567890.45);

 

--将数字转换为货币(拾贰亿叁仟肆佰伍拾陆万柒仟捌佰玖拾点肆伍)

 

1 string temp_7 = string.Format(new Microsoft.International.Formatters.EastAsiaNumericFormatter(), "{0:Lc}", 1234567890.45);

实例代码:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

 

//简体/繁体切换

            string temp_1 = ChineseConverter.Convert("中国人", ChineseConversionDirection.TraditionalToSimplified);

            string temp_2 = ChineseConverter.Convert("中国人", ChineseConversionDirection.SimplifiedToTraditional);

            Console.WriteLine("简体转换:"+temp_1+"\n繁体转换:"+temp_2);

            //汉字转换拼音

            string r = string.Empty;

            Console.Write("请输入任意汉字:");

            string str = Console.ReadLine();

            foreach (char obj in str)

            {

                try

                {

                    ChineseChar chineseChar = new ChineseChar(obj);

                    string t = chineseChar.Pinyins[0].ToString();

                    r += t.Substring(0, t.Length - 1);

                }

                catch

                {

                    r += obj.ToString();

                }

            }

            Console.WriteLine(r.ToLower().ToString());

 

源码:

  

2 3 Microsoft.International.Converters.TraditionalChineseTo

功效:

2 3 Microsoft.International.Converters.TraditionalChineseTo