|
CodePanic! > C#.NET Tips > 今ここ■byte配列を16進数文字列へBitConverterクラスを利用します。 byte[] data = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }; // 結果:00-01-02-03-04-05-06-07-08-09-0A-0B-0C-0D-0E-0F(ハイフンが付きます) BitConverter.ToString(data); // 結果:000102030405060708090A0B0C0D0E0F(ハイフンを削除したい場合) BitConverter.ToString(data).Replace("-",string.Empty) Tweet |