1. 数组复制
byte[] source;
byte[] dest;
int srcOffset = 0;
int dstOffset = 0;
int count = 10;
System.Buffer.BlockCopy(source, srcOffset, dest, dstOffset, count);
2.string转字节数组
byte[] inputByte = System.Text.Encoding.Unicode.GetBytes(text);
byte[] inputByte = System.Text.Encoding.ASCII.GetBytes(text);
3.字节数组转string
string str= System.Text.Encoding.UTF8.GetString(bytes);
4.windows换行符
Environment.NewLine
5.string转int
string str = "100";
int a = System.Int32.Parse(str);
6.判断Enter键是否按下
private void textBox1_KeyDown(object sender, KeyEventArgs e)
{
if(e.KeyCode == Keys.Enter)
{
MessageBox.Show("keydown");
}
}
7.