|
fbi
新手上路

积分 15
发帖 8
注册 2006-11-30
状态 离线
|
『楼 主』:
请大家测试!获取MAC并提交到网页中!
使用 LLM 解释/回答一下
运行mac.bat,会把本地的MAC信息生成一个c:\addmac.htm并运行,利用这个文件的自动跳转,用GET把MAC提交到mac.php处理!
已在win2003\xp\2000中测试可行!但在win98生成的c:\addmac.htm保存不了MAC信息
请大家看看是什么问题!
:::mac.bat::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
@echo
:::::::::如果c:\ipconfig.txt存在就把它删除
if exist c:\ipconfig.txt del c:\ipconfig.txt
:::::::::运行ipconfig /all命令并把其内容保存到ipconfig.txt
ipconfig /all >c:\ipconfig.txt
:::::::::如果c:\MyMAC.txt存在就把它删除
if exist c:\MyMAC.txt del c:\MyMAC.txt
:::::::::查询c:\ipconfig.txt中含有Physical Address一行,并把这行保存到c:\MyMAC.txt
find "Physical Address" c:\ipconfig.txt >c:\MyMAC.txt
:::::::::如果c:\addmac.htm存在就把它删除
if exist c:\addmac.htm del c:\addmac.htm
::@echo <meta http-equiv="refresh" content="1;URL=http://192.168.1.1/mac.php?macinfo=">
echo "<meta http-equiv='refresh' content='1;URL=http://localhost:8080/mac/addmac.php?macinfo=" >>c:\addmac.htm
@echo off&setlocal enabledelayedexpansion
for /f "tokens=1* delims=:" %%a in (c:\MyMAC.txt) do (
set c=%%b
if not defined a (<nul set/p pp=!c:~1,17!>>c:\addmac.htm&set a=1) else (<nul set/p pp=!pp!^|!c:~1,17!>>c:\addmac.htm)
)
echo "'>" >>c:\addmac.htm
start "" c:\addmac.htm
:::::::::如果c:\ipconfig.txt存在就把它删除
if exist c:\ipconfig.txt del c:\ipconfig.txt
:::::::::如果c:\MyMAC.txt存在就把它删除
if exist c:\MyMAC.txt del c:\MyMAC.txt
exit
::完::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Running mac.bat will generate the local MAC information into a c:\addmac.htm and run it. Using the automatic jump of this file, the MAC is submitted to mac.php for processing via GET!
It has been tested and works in win2003\xp\2000! But the c:\addmac.htm generated in win98 cannot save the MAC information
Please take a look at what the problem is!
:::mac.bat::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
@echo
:::::::::If c:\ipconfig.txt exists, delete it
if exist c:\ipconfig.txt del c:\ipconfig.txt
:::::::::Run ipconfig /all command and save its content to ipconfig.txt
ipconfig /all >c:\ipconfig.txt
:::::::::If c:\MyMAC.txt exists, delete it
if exist c:\MyMAC.txt del c:\MyMAC.txt
:::::::::Query the line containing Physical Address in c:\ipconfig.txt and save this line to c:\MyMAC.txt
find "Physical Address" c:\ipconfig.txt >c:\MyMAC.txt
:::::::::If c:\addmac.htm exists, delete it
if exist c:\addmac.htm del c:\addmac.htm
::@echo <meta http-equiv="refresh" content="1;URL=http://192.168.1.1/mac.php?macinfo=">
echo "<meta http-equiv='refresh' content='1;URL=http://localhost:8080/mac/addmac.php?macinfo=" >>c:\addmac.htm
@echo off&setlocal enabledelayedexpansion
for /f "tokens=1* delims=:" %%a in (c:\MyMAC.txt) do (
set c=%%b
if not defined a (<nul set/p pp=!c:~1,17!>>c:\addmac.htm&set a=1) else (<nul set/p pp=!pp!^|!c:~1,17!>>c:\addmac.htm)
)
echo "'>" >>c:\addmac.htm
start "" c:\addmac.htm
:::::::::If c:\ipconfig.txt exists, delete it
if exist c:\ipconfig.txt del c:\ipconfig.txt
:::::::::If c:\MyMAC.txt exists, delete it
if exist c:\MyMAC.txt del c:\MyMAC.txt
exit
::End::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|


|
|
2006-12-14 22:08 |
|
|
HUNRYBECKY
银牌会员
    
积分 1179
发帖 442
注册 2006-9-9
状态 离线
|
『第 2 楼』:
使用 LLM 解释/回答一下
根本就获取不到MAC
Simply cannot obtain the MAC address at all
|
|
2006-12-14 22:58 |
|
|
HUNRYBECKY
银牌会员
    
积分 1179
发帖 442
注册 2006-9-9
状态 离线
|
『第 3 楼』:
使用 LLM 解释/回答一下
有个建议,希望如果是内网,能否改成获取外网IP然后调用OE自动发邮件到指定油箱,这样的话就可以及时获取IP来进行远程连接和控制,系统维护就比较方便了。
感觉获取MAC好象没多大的意思。
There is a suggestion. If it's an internal network, can we change it to obtain the external network IP and then call OE to automatically send an email to the specified mailbox? In this way, we can obtain the IP in time for remote connection and control, and system maintenance will be more convenient. It feels like getting the MAC is not of much meaning.
|
|
2006-12-14 23:00 |
|
|
ccwan
金牌会员
     
积分 2725
发帖 1160
注册 2006-9-23 来自 河北廊坊
状态 离线
|
『第 4 楼』:
使用 LLM 解释/回答一下
恐怕联邦调查局有自己的想法吧?
呵呵……
I'm afraid the FBI has its own ideas, right?
Hehe...
|

三人行,必有吾师焉。 学然后知不足,教然后知困,然后能自强也。 |
|
2006-12-14 23:03 |
|
|
fbi
新手上路

积分 15
发帖 8
注册 2006-11-30
状态 离线
|
『第 5 楼』:
使用 LLM 解释/回答一下
Originally posted by fbi at 2006-12-14 09:08 AM:
运行mac.bat,会把本地的MAC信息生成一个c:\addmac.htm并运行,利用这个文件的自动跳转,用GET把MAC提交到mac.php处理!
已在win2003\xp\2000中测试可行!但在win98生栮..
你看看addmac.htm跳转后的地址栏后面的参数!
Originally posted by fbi at 2006-12-14 09:08 AM:
Run mac.bat, which will generate a local MAC information into a c:\addmac.htm and run, using the automatic jump of this file, use GET to submit the MAC to mac.php for processing!
Tested feasible in win2003\xp\2000! But in win98 raw...
You look at the address bar after the addmac.htm jump parameters!
|


|
|
2006-12-14 23:19 |
|
|
HUNRYBECKY
银牌会员
    
积分 1179
发帖 442
注册 2006-9-9
状态 离线
|
|
2006-12-14 23:34 |
|
|
HUNRYBECKY
银牌会员
    
积分 1179
发帖 442
注册 2006-9-9
状态 离线
|
|
2006-12-14 23:34 |
|
|
HUNRYBECKY
银牌会员
    
积分 1179
发帖 442
注册 2006-9-9
状态 离线
|
『第 8 楼』:
使用 LLM 解释/回答一下
能否提交到固定的网叶或FTP里?
Can it be submitted to a fixed webpage or FTP?
|
|
2006-12-14 23:36 |
|
|
kcdsw
中级用户
  
积分 404
发帖 179
注册 2006-3-30
状态 离线
|
『第 9 楼』:
使用 LLM 解释/回答一下
@echo off & setlocal enabledelayedexpansion
del c:\addmac.htm >nul 2>nul
for /f "tokens=1" %%a in ('getmac /nh') do (
>>c:\addmac.htm echo "<meta http-equiv='refresh' content='1;URL=http://localhost:80/mac/addmac.php?macinfo="%%a"'>"
start "" c:\addmac.htm
goto start
)
:start
pause
```
@echo off & setlocal enabledelayedexpansion
del c:\addmac.htm >nul 2>nul
for /f "tokens=1" %%a in ('getmac /nh') do (
>>c:\addmac.htm echo "<meta http-equiv='refresh' content='1;URL=http://localhost:80/mac/addmac.php?macinfo="%%a"'>"
start "" c:\addmac.htm
goto start
)
:start
pause
```
|
|
2006-12-15 04:32 |
|
|
fbi
新手上路

积分 15
发帖 8
注册 2006-11-30
状态 离线
|
|
2006-12-15 04:50 |
|
|
fbi
新手上路

积分 15
发帖 8
注册 2006-11-30
状态 离线
|
『第 11 楼』:
使用 LLM 解释/回答一下
Originally posted by kcdsw at 2006-12-14 03:32 PM:
@echo off & setlocal enabledelayedexpansion
del c:\addmac.htm >nul 2>nul
for /f "tokens=1" %%a in ('getmac /nh') do (
>>c:\addmac.htm echo "<m ...
但如果有多张网卡(多个MAC)就不成了!
Last edited by fbi on 2006-12-14 at 04:12 PM ]
But if there are multiple network cards (multiple MACs), it won't work!
Last edited by fbi on 2006-12-14 at 04:12 PM ]
|


|
|
2006-12-15 05:10 |
|
|
kcdsw
中级用户
  
积分 404
发帖 179
注册 2006-3-30
状态 离线
|
『第 12 楼』:
使用 LLM 解释/回答一下
你该看看getmac 的用法
You should take a look at the usage of getmac
|
|
2006-12-15 09:40 |
|
|
vkill
金牌会员
     
积分 4103
发帖 1744
注册 2006-1-20 来自 甘肃.临泽
状态 离线
|
『第 13 楼』:
使用 LLM 解释/回答一下
还不如直接 ipconfig /all 后ftp上传.txt
It's better to directly upload the .txt after ipconfig /all via FTP.
|
|
2006-12-16 09:52 |
|
|
tvzml
初级用户
 
积分 157
发帖 67
注册 2007-5-13
状态 离线
|
『第 14 楼』:
使用 LLM 解释/回答一下
@echo off & setlocal enabledelayedexpansion
del addmac.htm >nul 2>nul
For /F "tokens=2 delims=:" %%a in ('IpConfig /All^|Find /i "Physical Address. . . . . . . . . :"') do (
>>addmac.htm echo ^<meta http-equiv='refresh' content='1;URL=http://localhost:80/mac/addmac.php?macinfo="%%a"'^>
start "" addmac.htm
goto start
)
:start
pause
@echo off & setlocal enabledelayedexpansion
del addmac.htm >nul 2>nul
For /F "tokens=2 delims=:" %%a in ('IpConfig /All^|Find /i "Physical Address. . . . . . . . . :"') do (
>>addmac.htm echo ^<meta http-equiv='refresh' content='1;URL=http://localhost:80/mac/addmac.php?macinfo="%%a"'^>
start "" addmac.htm
goto start
)
:start
pause
|
|
2008-3-30 21:39 |
|