由买买提看人间百态

topics

全部话题 - 话题: macaddress
(共0页)
w**2
发帖数: 724
1
【 以下文字转载自 Programming 讨论区 】
发信人: wds2 (阿旺), 信区: Programming
标 题: perl sprintf question converting dec to hex
发信站: BBS 未名空间站 (Wed Mar 4 17:42:19 2015, 美东)
hi i have this line,
$MACAddress = sprintf("%06x", $MACAddress);
1. when $MACAddress was -1, this line converts it to ffffffffffffffff
instead of ffffffff, i'm on a 32-bit linux pc.
why ?
2. in my code, i need to write $MACAddress twice.
how to use some shortcut e.g. $1 ?
Thanks !
BTW, i LOVE Perl, :)
w**2
发帖数: 724
2
来自主题: Programming版 - perl sprintf question converting dec to hex
hi i have this line,
$MACAddress = sprintf("%06x", $MACAddress);
1. when $MACAddress was -1, this line converts it to ffffffffffffffff
instead of ffffffff, i'm on a 32-bit linux pc.
why ?
2. in my code, i need to write $MACAddress twice.
how to use some shortcut e.g. $1 ?
Thanks !
BTW, i LOVE Perl, :)
n*******e
发帖数: 4894
3
来自主题: Programming版 - perl sprintf question converting dec to hex
$MACAddress =sprintf("%.8s" ,(sprintf("%08x", $MACAddress)));
也许这是想要的?如果大于八位,就去掉末尾多余的
$MACAddress = sprintf("%08x", $MACAddress) =~ s/.*(\w{8})$/$1/r;
如果想truncate的是前面的,就用上面这种办法
f*******n
发帖数: 12623
4
来自主题: Programming版 - perl sprintf question converting dec to hex
$MACAddress = sprintf("%06x", $MACAddress & 0xffffffff);
u****s
发帖数: 2186
5
来自主题: shopping版 - 5个包子 refer dropbox
you can do it yourself, just takes some time/effort.
download VirtualBox from virtualbox.org, it's free
create a virtual machine (Windows or Linux depends who ISO file you have,
Linux ones are free)
take a snapshot
click on 'settings/network/advanced', click refresh icon for MacAddress
restart virtual machine,
register and download Dropbox client
you need create an email address for each cycle.
refer to the new email address on a different (or the host) computer
f****r
发帖数: 311
6
来自主题: DotNet版 - winxp networking problem: DHCP
Seems you do not have a home router.
I think the problem is that your desktop obtained an IPlease
from ISP, and MACaddress of the NIC is saved in the IP allocation table.
you will have to power of the modem for about 20sec till 1 minute
then power it on again then the modem may try to get a new IP lease
from the DHCP server. give it try and good luck.
l*******s
发帖数: 7316
7
来自主题: Internet版 - cox modem+chinese router 能DIY吗?
应该可以。
按D-Link, DIR-600NB的说明书设置就好。如果手头没有说明书, 在网上找个接近的也
行。比如这个 http://www.scribd.com/doc/28176828/DIR-600-User-Manual
很重要的一步是 Clone MAC Address:
The default MAC address is set to the WAN’s physicalinterface MAC address
on the Broadband Router. Youcan use the “Clone MAC Address” button to copy
the MACaddress of the Ethernet Card installed by your ISP andreplace the
WAN MAC address with the MAC address of therouter. It is not recommended
that you change the defaultMAC address unless required by your... 阅读全帖
l*******s
发帖数: 7316
8
来自主题: Internet版 - cox modem+chinese router 能DIY吗?
应该可以。
按D-Link, DIR-600NB的说明书设置就好。如果手头没有说明书, 在网上找个接近的也
行。比如这个 http://www.scribd.com/doc/28176828/DIR-600-User-Manual
很重要的一步是 Clone MAC Address:
The default MAC address is set to the WAN’s physicalinterface MAC address
on the Broadband Router. Youcan use the “Clone MAC Address” button to copy
the MACaddress of the Ethernet Card installed by your ISP andreplace the
WAN MAC address with the MAC address of therouter. It is not recommended
that you change the defaultMAC address unless required by your... 阅读全帖
(共0页)