生成12位十六进制密码

Random r = new Random();
            byte[] bytes = new byte[6];
            
            var t = new StringBuilder();
            for (int j = 0; j < 16; j++)
            {
                r.NextBytes(bytes);
                t.AppendLine("KeyA["+ j +"] = \"" + ByteHexHelper.ByteToHex(bytes) + "\";");
            }
            for (int j = 0; j < 16; j++)
            {
                r.NextBytes(bytes);
                t.AppendLine("KeyB[" + j + "] = \"" + ByteHexHelper.ByteToHex(bytes) + "\";");
            }
            textBox3.Text = t.ToString();

 

posted @ 2016-07-27 12:31  shiningrise  阅读(850)  评论(0编辑  收藏  举报
// 侧边栏目录 // https://blog-static.cnblogs.com/files/douzujun/marvin.nav.my1502.css