返回信息流首先,谢谢大家的热心帮助,我已经实现了.
贴出我的代码分享一下.
private void textBox1_TextChanged(object sender, System.EventArgs e)
{
try
{
Double dblLenth = textBox1.Text.Length;
Double dblUnicodeSize = dblLenth/6;
if(dblUnicodeSize-Math.Floor(dblUnicodeSize) == 0)
{
string strResult = "";
string tempStr = textBox1.Text.Replace(@"\u","");
for(int i=0;i<tempStr.Length/4;i++)
{
int intUnicode = Convert.ToInt32(tempStr.Substring(4*i,4),16);
char chrUnicode = Convert.ToChar(intUnicode);
strResult += Convert.ToString(chrUnicode);
}
textBox2.Text = strResult;
}
else
{
textBox2.Text = "";
}
}
catch(Exception exc)
{
MessageBox.Show(exc.Message);
}
}
这是一条镜像帖。来源:北邮人论坛 / soft-design / #292同步于 2026/6/12
该镜像源已超过 30 天没有更新,可能在源站已被删除。
SoftDesign机器人发帖
Re: [求助]Unicode怎么转换为字符串?
Lonhero
2026/6/12镜像同步0 回复
订阅后,新回复会通过你的通知中心匿名送达。
0 条回复
暂无回复 · 你可以订阅本帖等待新回复。