【发布时间】:2016-04-11 15:40:23
【问题描述】:
我将音乐文件转换为byte,现在我需要知道如何将byte 转换为int。
我尝试了以下方法,但失败了:
BitConverter.ToInt32(array, 0);
【问题讨论】:
-
如果你们有很好的方法将音乐文件转换为字节,我也试过了
-
int intValue = listBox1.SelectedIndex;尝试 { byte[] intBytes = BitConverter.GetBytes(intValue); if (BitConverter.IsLittleEndian) Array.Reverse(intBytes);字节 [] 结果 = intBytes; SqlCommand com = new SqlCommand("INSERT INTO tblVoice(flbVoice) VALUE (intBytes)");
-
BitConverter.ToInt32 将查看 4 个字节。
array有 4 个字节吗? -
欢迎来到 SO;你可以在how to ask 和how to create a good example 上读到一些东西。另外,请不要将 cmets 发布到您的问题中,而是编辑问题
-
等等,让我看看我是否理解这一点...您将 music 文件转换为
byte数组,并希望将其转换为单个数字?您对此的真实期望是什么?
标签: c#