/// <summary> /// 字符串转为简体中文 /// </summary> /// <param name="str">简体中文字符串</param> /// <returns>繁体中文字符串</returns> public string StringToSimlified(string str, bool useChineseConverClass = true) { try { if (useChineseConverClass) { return(ChineseConvert.ToSimplified(str)); } else { return(Microsoft.VisualBasic.Strings.StrConv(str, Microsoft.VisualBasic.VbStrConv.SimplifiedChinese, 0)); } } catch (Exception) { return(""); } }
/// <summary> /// 字符串转为简体中文 /// </summary> /// <param name="str">简体中文字符串</param> /// <returns>繁体中文字符串</returns> public string StringToSimlified(string str, enumConvertOption convertOption = enumConvertOption.OldWord) { try { switch (convertOption) { case enumConvertOption.Quick: return(Microsoft.VisualBasic.Strings.StrConv(str, Microsoft.VisualBasic.VbStrConv.SimplifiedChinese, 0)); case enumConvertOption.OldWord: return(ChineseConvert.ToSimplified(str)); case enumConvertOption.High: return(HighConvert.Cht2Chs(str)); default: return(""); } } catch (Exception) { return(""); } }