Created
September 17, 2017 01:50
-
-
Save LucasBonafe/2124e6fdd9152e39565dc028e854aa16 to your computer and use it in GitHub Desktop.
Creates a variable and assigns the MAC address to it in only 1 line of code.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var MACaddr=NetworkInterface.GetAllNetworkInterfaces().Where(nic => nic.OperationalStatus == OperationalStatus.Up).Select(nic => nic.GetPhysicalAddress().ToString()).FirstOrDefault(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment