Get Mac Address

how to get mac address using uipath.

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

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

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:

3 Likes

@arivu96 GJ :+1:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.