在.netframework2.0 实现简体和繁体字的相互转换.
首先对Miscrosoft.VisualBasic类的引用.
- using Microsoft.VisualBasic;
-
- public static string Traditional2Simplified(string str)
- {
- return (Microsoft.VisualBasic.Strings.StrConv(str, Microsoft.VisualBasic.VbStrConv.SimplifiedChinese, 0));
-
- }
- public static string Simplified2Traditional(string str)
- {
- return (Microsoft.VisualBasic.Strings.StrConv(str as String, Microsoft.VisualBasic.VbStrConv.TraditionalChinese, 0));
-
- }
-