Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

Get unique id of Device

  //******************* Source: NAYCode.com
private string GetDeviceInfo()
        {
            string mac = string.Empty;
            string ip = string.Empty;

            foreach (var netInterface in NetworkInterface.GetAllNetworkInterfaces())
            {
                if (netInterface.NetworkInterfaceType == NetworkInterfaceType.Wireless80211 ||
                    netInterface.NetworkInterfaceType == NetworkInterfaceType.Ethernet)
                {
                    var address = netInterface.GetPhysicalAddress();
                    mac = BitConverter.ToString(address.GetAddressBytes());

                    IPAddress[] addresses = Dns.GetHostAddresses(Dns.GetHostName());
                    if (addresses != null && addresses[0] != null)
                    {
                        ip = addresses[0].ToString();
                        break;
                    }
                }
            }

            return mac;
        }
      
Comment

PREVIOUS NEXT
Code Example
Csharp :: c# $ string 
Csharp :: read all lines split C# 
Csharp :: c# to pascal case 
Csharp :: how to add event function from code in wpf 
Csharp :: open linkedlabel c# 
Csharp :: context.Response.Body read stream .net 
Csharp :: unity scene switch 
Csharp :: stock span problem c# using class 
Csharp :: c# Intersectcase insensitive 
Csharp :: moving camera with touch screen unity 
Csharp :: unity rotate around point 
Csharp :: Make UI/Canvas look at Camera always. 
Csharp :: how set format persian data picker to en 
Csharp :: C# ValidationAttribute required when 
Csharp :: unity basic public options 
Csharp :: extension method in c# 
Csharp :: how to parse mongo db json in c# 
Csharp :: c# query string builder 
Csharp :: c# enum get string value 
Csharp :: string is int f# 
Csharp :: unity stop object from rotating 
Csharp :: httpclient getstringasync 
Csharp :: c# file to byte array 
Csharp :: check if list contains any empty element in c# 
Csharp :: c# check that value is not null or 0 
Csharp :: linq convert list to another list 
Csharp :: c# mysql select into datatable 
Csharp :: insert data to access database c# 
Csharp :: list view in unity 
Csharp :: triangle 
ADD CONTENT
Topic
Content
Source link
Name
6+5 =