string s = "02-56-00-FF-FF-0B-4F-21-14-A2-1C-D5-4C-37-9B-CD";
string[] ss = s.Split('-');
byte[] b = new byte[ss.Length];
for (int i = 0; i < ss.Length; i++)
{
b[i] = (byte)Convert.ToInt32(ss[i], 16);
}
转载于:https://www.cnblogs.com/liuwanlin/archive/2009/12/24/1631046.html