mac-address

How can I get the MAC address of network printer via C#?

China☆狼群 提交于 2019-12-11 20:11:22
问题 I wanna get the identifier of a Intermec barcode printer, it uses network interface, so I think of MAC address. How can I get the MAC address via C#? Or I can get the serial number of the printer directly? 回答1: I am assuming that you have the IP address of the network printer and your pc and the printer are at the same local network. You can give this program a try. static void Main(string[] args) { PhysicalAddress pa = LocateMacAddress(IPAddress.Parse("172.16.0.99")); Console.WriteLine(pa

Is there a persistent replacement for UDID?

China☆狼群 提交于 2019-12-11 19:26:09
问题 My requirement is for a UDID that persists across device reboots, OS updates, app re-installs, and device resets (ie the user chooses Settings > General > Reset). I'm not trying to breach any security on the device; this is for a financial app. As I understand it, OpenUDID is deprecated. I have not figured out whether SecureUDID is useful, given that users can opt out and for security reasons. The advertiser ids and vendor ids are not persistent. Saving an ID in keychains or user defaults

MAC Address equivalent to identify ASP.NET website's visitors

旧城冷巷雨未停 提交于 2019-12-11 15:33:51
问题 I have a registration page that sends a Welcome SMS for every registered user where the username is the user's mobile number. In the welcome SMS there is an activation code to complete the registration process. I also uses a Captcha control to prevent people from using bots. The problem is, Some bad users are using the registration page to send SMS's to random mobile numbers which makes me loses the SMS credit. Getting the MAC address of a website visitor is impossible, If it was possible, I

Changing the MAC Address in Vista - Broadcom adapter

我们两清 提交于 2019-12-11 15:08:26
问题 Is there a way that we could override the default mac address / set a new mac address on a Vista machine for a Broadcom adapter ? 回答1: Can't say for your particular case, but I've used one of the two tools mentioned over here to spoof/change the MAC address of the Ethernet adapter on Windows Vista before. 回答2: Probably not - this is easy in Linux though :) 来源: https://stackoverflow.com/questions/307932/changing-the-mac-address-in-vista-broadcom-adapter

Change MAC address Cocoa - Objective-C

牧云@^-^@ 提交于 2019-12-11 14:45:11
问题 How can I change the MAC address via Objective-C? Looking for a simple solution. I already have a shell script (Bash) that can do it if that helps. How would I open that from my Cocoa application? Thanks. 回答1: You can run external commands using NSTask. However, it's likely that changing the MAC address requires superuser privileges so you will have to look into authorization as well. 来源: https://stackoverflow.com/questions/4825332/change-mac-address-cocoa-objective-c

Regex matching MAC address

假如想象 提交于 2019-12-11 09:03:40
问题 I'm trying to get all valid MAC addresses from this string: 00:1e:68:51:4f:a9 <-> 00:1a:8c:10:ad:30 9 540 8 336 17 876 90.457130000 198.0143 I've tried this and a few other regexes: ^([0-9A-F]{2}[:]){5}([0-9A-F]{2})$ Regex 101 here: https://regex101.com/r/kI5nI6/1 I can't figure out why I'm not getting any matches. 回答1: You have to remove the anchors ^ and $ You have to add a-z in your character set.. or make the searches case insensitive with (?i) (i modifier) Following will work: ([0-9a-fA

java.net.NetworkInterface.getNetworkInterfaces() not listing all interfaces for OS X

蹲街弑〆低调 提交于 2019-12-11 06:38:03
问题 https://stackoverflow.com/a/17719579/2619129 provides a solution for Linux. I am looking for a similar solution for OS X, but not sure which files to read to get the list of Interfaces (file /proc/net/dev in linux) and then their HardwareAddresses (file /sys/class/net/devicename/address in linux). My ultimate goal is to list Mac-Addresses of all the NetworkInterfaces (which gets listed as result of ifconfig command) on OS X implemented in pure Java. 来源: https://stackoverflow.com/questions

Python and libpcap. find source mac address of packet

丶灬走出姿态 提交于 2019-12-11 03:19:10
问题 I'm writing python program to build mac-address cache using pcap. But pcap module for python has no good documentation. I have found this page http://pylibpcap.sourceforge.net/ with code example and it works fine. Can anybody modify this example to make it able to show the source mac-address for each packet? Or point me to the documentation where I can read about it ... updated Here is a code part where information about mac addresses were cut. def print_packet(pktlen, data, timestamp): if

Python: get MAC address of default gateway

て烟熏妆下的殇ゞ 提交于 2019-12-11 02:32:38
问题 Is there any quick way in Python to get the MAC address of the default gateway ? I can't make any ARP requests from the Linux machine I'm running my code on, so it has to come directly from the ARP table . 回答1: The following DevFS files will provide this information: /proc/net/arp /proc/net/route Find the route entry with 0/0 as the host/mask: Iface Destination Gateway Flags RefCnt Use Metric Mask MTU Window IRTT eth0 00000000 B91A210A 0003 0 0 100 00000000 0 0 0 and convert the Gateway field

Python get normal HEX format for MAC-Adress

…衆ロ難τιáo~ 提交于 2019-12-11 00:13:32
问题 I want a normal format for the MAC-Address I got from get_node(). The format I get is 0x0L0xdL0x60L0x76L0x31L0xd6L, I want the 0x deleted and the L-term to a real hex number. It should be 00-0D-60-76-31-D6 . How can I realize this? def getNetworkData (self): myHostname, myIP, myMAC = AU.getHostname() touple1 = (myMAC & 0xFF0000000000) >> 40 touple2 = (myMAC & 0x00FF00000000) >> 32 touple3 = (myMAC & 0x0000FF000000) >> 24 touple4 = (myMAC & 0x000000FF0000) >> 16 touple5 = (myMAC &