![]() ![]() With the help of Yahia I was able to code the following solution. I am looking for a method in C# which generates a random MAC number. Var result = String.Concat(buffer.Select(x => string.Format("", x.ToString("X2"))).ToArray()) ![]() Solution 2Ī slightly less verbose solution (which I think still achieves the same outcome): public static string GetRandomMacAddress() A media access control address (MAC address) of a device is a unique identifier assigned to network interface controllers for communications at the data link layer of a network segment. X2, 2 digits per number, left padded with 0) and join these together with : as delimiter. This generator generates random MAC address. You will need to write one yourself - read the format description, use a random generator to get 6 random numbers between 0 and 255, setup the 2 relevant bits (for globally unique/locally administered) as need be and then transform the number to hex (i.e. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |