mac-address

C# Get Computer's MAC address “OFFLINE”

こ雲淡風輕ζ 提交于 2019-11-27 05:34:27
问题 Is there any way to get computer's mac address when there is no internet connection in c#? I'am able to get when I have connection but not able to get when I am offline. But strongly I need the mac address for my work. My online code; var macAddr = (from nic in NetworkInterface.GetAllNetworkInterfaces() where nic.OperationalStatus == OperationalStatus.Up select nic.GetPhysicalAddress().ToString()).FirstOrDefault(); 回答1: From WMI: public static string GetMACAddress1() {

Obtain MAC Address from Devices using Python

◇◆丶佛笑我妖孽 提交于 2019-11-27 03:51:31
I'm looking for a way (with python) to obtain the layer II address from a device on my local network. Layer III addresses are known. The goal is to build a script that will poll a databases of IP addresses on regular intervals ensuring that the mac addresses have not changed and if they have, email alerts to myself. Jed Smith To answer the question with Python depends on your platform. I don't have Windows handy, so the following solution works on the Linux box I wrote it on. A small change to the regular expression will make it work in OS X. First, you must ping the target. That will place

MAC address with getifaddrs

泪湿孤枕 提交于 2019-11-27 02:22:23
问题 Is there a way to get interface's MAC address via getifaddrs() ? I already have this, to get IP addresses, but I have kinda missed MAC . Ive tried to look for the information in getifaddrs() , but there is nothing about MAC addresses struct ifaddrs *iflist, *iface; if (getifaddrs(&iflist) < 0) { perror("getifaddrs"); } char addrp[INET6_ADDRSTRLEN]; char macp[INET6_ADDRSTRLEN]; int i=0; for (iface = iflist; iface; iface = iface->ifa_next) { int af = iface->ifa_addr->sa_family; const void *addr

Get a machines MAC address on the local network from its IP in C#

让人想犯罪 __ 提交于 2019-11-27 01:58:47
问题 I am trying write a function that takes a single IP address as a parameter and queries that machine on my local network for it's MAC address . I have seen many examples that get the local machine's own MAC address , however none (I've found) that seem to query a local network machine for it. I know such a task is achievable as this Wake on LAN scanner software scans the local IP range and returns MAC address/Hostname of all on machines. Can anyone tell me where I'd get started trying to write

Read MAC Address from network adapter in .NET

冷暖自知 提交于 2019-11-27 01:36:16
I'd like to be able to read the mac address from the first active network adapter using VB.net or C# (using .NET 3.5 SP1) for a winform application Stu Mackellar Since .Net 2.0 there's been a NetworkInterface class in the System.Net.NetworkInformation namespace that will give you this information. Try this: foreach (NetworkInterface nic in NetworkInterface.GetAllNetworkInterfaces()) { if (nic.OperationalStatus == OperationalStatus.Up) { Console.WriteLine(nic.GetPhysicalAddress().ToString()); break; } } from http://www.dotnetjunkies.com/WebLog/jkirwan/archive/2004/02/10/6943.aspx Dim mc As

Getting MAC address in Android 6.0

心不动则不痛 提交于 2019-11-27 00:54:16
I'm developing an app that gets the MAC address of the device, but since Android 6.0 my code doesn't work, giving me an incorrect value. Here's my code... public String ObtenMAC() { WifiManager manager = (WifiManager) getSystemService(Context.WIFI_SERVICE); WifiInfo info = manager.getConnectionInfo(); return(info.getMacAddress().toUpperCase()); } Instead of the real MAC address, it returns an strange code: 02:00:00:00:00:00 . Please refer to Android 6.0 Changes . To provide users with greater data protection, starting in this release, Android removes programmatic access to the device’s local

Manage ifaddrs to return MAC addresses as well in Swift

梦想的初衷 提交于 2019-11-26 23:17:45
问题 I've got the following code that successfully retrieves all the IPs connected to my router. But I need to a get the MAC Addresses for each IP. So instead of addresses being returned as an array with [ips] , be returned as a dictionary [ips:0000000, mac: 000000] Is it possible to be achieved with changes to the following code (from How to get Ip address in swift)? func getIFAddresses() -> [String] { print("GET IF ADDRESSSE") var addresses = [String]() // Get list of all interfaces on the local

How can I get a MAC address from an HTTP request?

二次信任 提交于 2019-11-26 22:50:13
Can someone give me some pointers on picking up the user's MAC address from an HTTP request? The users will be from outside my network. rioki It depends on your network setup. But probably no. Here is a short refresher on Ethernet and IP. The MAC address is a unique address of the network card. It is used to identify for which user on the network segment a packet is. You can use ARP to get a MAC address for an IP address. But this works as expected only if you are on the same network segment . So the question is, what is a network segment? It depends on the technology you use, but here are the

How to get iOS device MAC address programmatically

我的梦境 提交于 2019-11-26 22:44:56
How do I get an iOS device's MAC code programmatically in my app? Jøhn Nârrøw Now iOS 7 devices – are always returning a MAC address of 02:00:00:00:00:00. So better use [UIDevice identifierForVendor] so better to call this method to get app specific unique key Category will more suitable #import "UIDevice+Identifier.h" - (NSString *) identifierForVendor1 { if ([[UIDevice currentDevice] respondsToSelector:@selector(identifierForVendor)]) { return [[[UIDevice currentDevice] identifierForVendor] UUIDString]; } return @""; } Now call above method to get unique address NSString *like_UDID=[NSString

iOS - Get ARP table

跟風遠走 提交于 2019-11-26 20:46:41
问题 I am trying to build a network scanner. I know the procedure so I want to ping all available hosts in the network and then get the ARP table so I can map the MAC address for each IP. I Googled for ARP table but I didn't find any guide how to implement this feature. I also found these similar questions on Stack overflow: Link1 Link2 The answer are unclear on how to implement the ARP feature. Is there any official guide for this one? Is Apple approving the ARP table feature? 回答1: UPDATE AFTER