// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; using System.Globalization; namespace E { public class MainClass { public static void Main(string[] args) { string macs = "02:00:00:D0:CE:92"; string[] parts = macs.Split(':'); byte[] macb = new byte[parts.Length]; for(int i = 0; i < parts.Length; i++) { macb[i] = byte.Parse(parts[i], NumberStyles.AllowHexSpecifier); } foreach(byte b in macb) { Console.WriteLine(b); } } } }