Get Mac Address


#1

how to get mac address using uipath.


#2

I tested the following code in C# LINQ query and working fine.

Please give a try -

        var macAddr = (
            from nic in NetworkInterface.GetAllNetworkInterfaces()
            where nic.OperationalStatus == OperationalStatus.Up
            select nic.GetPhysicalAddress().ToString()
        ).FirstOrDefault();

        Console.WriteLine(macAddr.ToString());

Regards,
Karthik Byggari


#3

how to use this c# code in uipath as invoke code only supports vb.net, is there any other way.


#4

Hi @ram_charan,

please refer the xaml file to get the Mac Address.
GetMacAddress.xaml (7.3 KB)

Dim nics() As System.Net.NetworkInformation.NetworkInterface = System.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces() MacAddress=nics(1).GetPhysicalAddress.ToString

Regards,
Arivu :slight_smile: