Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

random mac address c#

public static string GetRandomMacAddress()
{
    var random = new Random();
    var buffer = new byte[6];
    random.NextBytes(buffer);
    var result = String.Concat(buffer.Select(x => string.Format("{0}:", x.ToString("X2"))).ToArray());
    return result.TrimEnd(':');
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: Write text in Word Document at specific location using C# 
Csharp :: Reverse Coding Challenge 1 
Csharp :: mvc refresh page from controller 
Csharp :: how to load file from resources in c# 
Csharp :: c# get classes which inherits 
Csharp :: char array 
Csharp :: All Possible SubString 
Csharp :: Get enum value from string or int 
Csharp :: c# random number between 0 and 1 
Csharp :: how to make a string a list of characters c# 
Csharp :: entity framework core db first 
Csharp :: .net core 6 autofac 
Csharp :: mvc string format 
Csharp :: string substring c# before 
Csharp :: c# combobox with text and value 
Csharp :: if list does not contain then add c# 
Csharp :: get device name c# console 
Csharp :: recursively reverse linked list 
Csharp :: c# dictionary with dictionary as value 
Csharp :: unity initialize array 
Csharp :: how to add data in list in c# 
Csharp :: c# tuple 
Csharp :: c# add strings 
Csharp :: count the number of notes in a given amount c# 
Csharp :: string interpolation in c# 
Csharp :: check if two date ranges overlap c# 
Csharp :: c# calendar button random dates 
Csharp :: decimal operator in Convert.toDouble() C# 
Csharp :: xamarin set environment variables 
Csharp :: link form to a button in dashbord visual c# 
ADD CONTENT
Topic
Content
Source link
Name
3+2 =