如何将Unicode字符串转换为中文字符串
例如:"\u6309\u94ae\u80cc\u666f\u8272"
     转换结果:”按钮背景色“谢谢!

解决方案 »

  1.   

    string strValue = "\u6309\u94ae\u80cc\u666f\u8272";
    MessageBox.Show( strValue );
      

  2.   

    我想让它在Label中显示,怎么办
      

  3.   

    to 我想让它在Label中显示,怎么办yourLabel.Text = "\u6309\u94ae\u80cc\u666f\u8272";
      

  4.   

    string sTextBox1 = this.textBox1.Text.Trim().ToString();
    MessageBox.Show(sTextBox1);sTextBox1变量是@\u6309\u94ae\u80cc\u666f\u8272
    MessageBox.Show的输出结果是\u6309\u94ae\u80cc\u666f\u8272如何解决“@”这个问题
      

  5.   

    如果这样就比较麻烦了,你需要自己去转,例如:
    string strValue = textBox1.Text;
    strValue = strValue.Replace( @"\u", " " );
    strValue = strValue.Trim( );
    string[] strItems = strValue.Split( ' ' );
    strValue = "";
    foreach( string strItem in strItems )
    {
    strValue += Convert.ToChar( Convert.ToInt32( strItem, 16 ) );
    }
    MessageBox.Show( strValue );