您当前的位置: 首页 >  c#

蓝不蓝编程

暂无认证

  • 0浏览

    0关注

    706博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

C# 知识点收集

蓝不蓝编程 发布时间:2014-02-17 22:36:54 ,浏览量:0

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.

关注
打赏
1639405877
查看更多评论
立即登录/注册

微信扫码登录

0.0388s