资 源 简 介
Visual C# 简繁体转换,实现中文汉字的简体繁体转换功能,相信这个C#小程序源码会很实用吧,经常用到。编译运行后,请输入要转换的文字,单击对应的按钮,即可实现转换功能,绑定在对应按钮上的代码如下:
C#中文繁体转简体源码:
private void button1_Click(object sender, EventArgs e)
{
string src = txtSrcText.Text.Trim();
byte[] srcByte = Encoding.Default.GetBytes(src);
byte[] desByte = new byte[srcByte.Length];
LCMapString(2052, LCMAP_SIMPLIFIED_CHINESE, srcByte, -1, desByte, srcByte.Length);
string des = Encoding.Default.GetString(desByte);
txtDesText.Text = des;
}
C#中文简体转繁体源码:
private void button2_Click(object sender, EventArgs e)
{
string src = txtSrcText.Text.Trim();
byte[] srcByte = Encoding.Default.GetBytes(src);
byte[] desByte = new byte[srcByte.Length];
LCMapString(2052, LCMAP_TRADITIONAL_CHINESE, srcByte, -1, desByte, srcByte.Length);
string des = Encoding.Default.GetString(desByte);
txtDesText.Text = des;
}