C#二进制数组的字符串形式转换为二进制Byte数组



二进制数组的字符串形式转换为二进制Byte数组

	    if ((sBinText.Length % 2) != 0)
                sBinText += " ";
            bLabelContent = new byte[sBinText.Length / 2];
            string sTmp;
            for (int i = 0; i < bLabelContent.Length; i++)
            {
                sTmp = sBinText.Substring(i * 2, 2);
                bLabelContent[i] = Convert.ToByte(sTmp, 16);
            }

你可能感兴趣的:(.Net)