/// <summary>
/// 转繁体
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected string fan(string val)
{
if (string.IsNullOrEmpty(val))
{
return "";
}
else
{
string value = val.Trim();
string newValue = StringConvert(value, "1");
if (!string.IsNullOrEmpty(newValue))
{
return newValue;
}
return "";
}
}
/// <summary>
/// 转简体
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected string jian(string val)
{
if (string.IsNullOrEmpty(val))
{
return "";
}
else
{
string value = val.Trim();
string newValue = StringConvert(value, "2");
if (!string.IsNullOrEmpty(newValue))
return newValue;
return "";
}
}
#region IString 成员
public string StringConvert(string x, string type)
{
String value = String.Empty;
switch (type)
{
case "1"://转繁体
value = Microsoft.VisualBasic.Strings.StrConv(x, Microsoft.VisualBasic.VbStrConv.TraditionalChinese, 0);
break;
case "2":
value = Microsoft.VisualBasic.Strings.StrConv(x, Microsoft.VisualBasic.VbStrConv.SimplifiedChinese, 0);
break;
default:
break;
}
return value;
}
#endregion