using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Example41
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
char[] P_chr = textBox1.Text.ToCharArray(); //从字符串中得到字节数组
Array.Reverse(P_chr, 0, textBox1.Text.Length); //反转字节数组
textBox2.Text = new StringBuilder().Append(P_chr).ToString(); //将字节数组转换为字符串输出
}
}
}