mac-address

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

蹲街弑〆低调 提交于 2019-11-26 08:27:07
问题 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. 回答1: 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

How to get iOS device MAC address programmatically

≯℡__Kan透↙ 提交于 2019-11-26 08:25:55
问题 How do I get an iOS device\'s MAC code programmatically in my app? 回答1: 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]

Getting MAC address in Android 6.0

人走茶凉 提交于 2019-11-26 08:14:29
问题 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 . 回答1: Please refer to Android 6.0 Changes. To provide users with

How do I query the ARP table on iPhone?

眉间皱痕 提交于 2019-11-26 05:23:39
问题 I am new on iPhone development, and I want to integrate wake-on-lan into my application without squeezing my users to enter the computers MAC address when the IP is already known. I googled for about some hours, took the source code of an ARP tool, but I don\'t know how to manage this on iPhone. 回答1: Since nobody has answered my question... here is the answer ;) #include <sys/param.h> #include <sys/file.h> #include <sys/socket.h> #include <sys/sysctl.h> #include <net/if.h> #include <net/if_dl

How to get MAC address of your machine using a C program?

流过昼夜 提交于 2019-11-26 05:00:33
问题 I am working on Ubuntu. How can I get MAC address of my machine or an interface say eth0 using C program. 回答1: You need to iterate over all the available interfaces on your machine, and use ioctl with SIOCGIFHWADDR flag to get the mac address. The mac address will be obtained as a 6-octet binary array. You also want to skip the loopback interface. #include <sys/ioctl.h> #include <net/if.h> #include <unistd.h> #include <netinet/in.h> #include <string.h> int main() { struct ifreq ifr; struct

Programmatically getting the MAC of an Android device

半腔热情 提交于 2019-11-26 04:07:32
问题 I need to obtain the MAC address of my android device using Java. I\'ve searched online, but I haven\'t found anything useful. 回答1: As was already pointed out in the comment, the MAC address can be received via the WifiManager. WifiManager manager = (WifiManager) getSystemService(Context.WIFI_SERVICE); WifiInfo info = manager.getConnectionInfo(); String address = info.getMacAddress(); Also do not forget to add the appropriate permissions into your AndroidManifest.xml <uses-permission android

How can I programmatically get the MAC address of an iphone

喜夏-厌秋 提交于 2019-11-26 03:14:32
问题 How to programmatically get an iPhone\'s MAC address and IP address? 回答1: NOTE As of iOS7, you can no longer retrieve device MAC addresses. A fixed value will be returned rather than the actual MAC Somthing I stumbled across a while ago. Originally from here I modified it a bit and cleaned things up. IPAddress.h IPAddress.c And to use it InitAddresses(); GetIPAddresses(); GetHWAddresses(); int i; NSString *deviceIP = nil; for (i=0; i<MAXADDRS; ++i) { static unsigned long localHost =

Get MAC address on local machine with Java

自作多情 提交于 2019-11-26 02:21:49
问题 I can use ip = InetAddress.getLocalHost(); NetworkInterface.getByInetAddress(ip); to obtain the mac address, but if I use this code in an offline machine it doesn\'t work. So, How can I get the Mac address? 回答1: With Java 6+, you can use NetworkInterface.getHardwareAddress. Bear in mind that a computer can have no network cards, especially if it's embedded or virtual. It can also have more than one. You can get a list of all network cards with NetworkInterface.getNetworkInterfaces(). 回答2:

Reliable method to get machine&#39;s MAC address in C#

断了今生、忘了曾经 提交于 2019-11-26 01:31:47
问题 I need a way to get a machine\'s MAC address regardless of the OS it is running using C#. Application will need to work on XP/Vista/Win7 32 and 64 bit as well as on those OSs but with a foreign language default. Many of the C# commands and OS queries don\'t work across OS. Any ideas? I have been scraping the output of \"ipconfig /all\" but this is terribly unreliable as the output format differs on every machine. Thanks 回答1: Cleaner solution var macAddr = ( from nic in NetworkInterface

How can I get the MAC and the IP address of a connected client in PHP?

心不动则不痛 提交于 2019-11-25 23:00:58
问题 I need to know the MAC and the IP address of the connect clients, how can I do this in PHP? 回答1: Server IP You can get the server IP address from $_SERVER['SERVER_ADDR'] . Server MAC address For the MAC address, you could parse the output of netstat -ie in Linux, or ipconfig /all in Windows. Client IP address You can get the client IP from $_SERVER['REMOTE_ADDR'] Client MAC address The client MAC address will not be available to you except in one special circumstance: if the client is on the