C#简繁体转换

原文链接

复制代码
 1 /// <summary>
 2 /// 字符串简体转繁体
 3 /// </summary>
 4 /// <param name="strSimple"></param>
 5 /// <returns></returns>
 6 public static string ToTraditionalChinese(string strSimple)
 7 {
 8     string strTraditional = Microsoft.VisualBasic.Strings.StrConv(strSimple, Microsoft.VisualBasic.VbStrConv.TraditionalChinese, 0);
 9     return strTraditional;
10 }
11 
12 /// <summary>
13 /// 字符串繁体转简体
14 /// </summary>
15 /// <param name="strTraditional"></param>
16 /// <returns></returns>
17 public static string ToSimplifiedChinese(string strTraditional)
18 {
19     string strSimple = Microsoft.VisualBasic.Strings.StrConv(strTraditional, VbStrConv.SimplifiedChinese, 0);
20     return strSimple;
21 }
复制代码

找不到Microsoft.VisualBasic解决方法:
右击项目:点击[添加引用]。把这个 Microsoft.VisualBasic...引用到项目

posted on 2015-04-16 12:25  飞翔蚂蚁  阅读(2633)  评论(0编辑  收藏  举报

导航