Diese Methode wandelt einen String z.B. "0xff" in ein byte um.
/// <summary>
/// Get byte by string
/// </summary>
/// <param name="strHexvalue">a hex string e.g. "0xff"</param>
/// <returns>byte</returns>
private byte GetByte(string strHexvalue)
{
int intHex = int.Parse(strHexvalue.Substring(2), System.Globalization.NumberStyles.AllowHexSpecifier);
return Convert.ToByte(intHex.ToString(), 10);
}
Kommentare zum Snippet