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 @ 2013-03-14 14:15  Clin  阅读(4215)  评论(1编辑  收藏  举报