public string TranToTrade(string text)//轉換為繁體
{
if (text.ToString().Length > 0)
{
string Sstr = Conversions.ToString(this.getSimple());
string Tstr = Conversions.ToString(this.getTrade());
char[] TradeArr = Tstr.ToCharArray(0, Tstr.Length - 1);
int VB$t_i4$L0 = text.Length - 1;
for (int i = 0; i <= VB$t_i4$L0; i++)
{
char oldstr = Conversions.ToChar(text.Substring(i, 1));
if (Sstr.Contains(Conversions.ToString(oldstr)))
{
char newstr = TradeArr[Sstr.IndexOf(oldstr)];
text = text.Replace(oldstr, newstr);
}
}
return text;
}
//Interaction.MsgBox("沒有輸入任何漢字", MsgBoxStyle.OkOnly, null);
return text;
}
public string TranToSimple(string text)//轉換為簡體.
{
if (text.ToString().Length > 0)
{
string Sstr = Conversions.ToString(this.getSimple());
string Tstr = Conversions.ToString(this.getTrade());
char[] simpleArr = Sstr.ToCharArray(0, Sstr.Length - 1);
int VB$t_i4$L0 = text.Length - 1;
for (int i = 0; i <= VB$t_i4$L0; i++)