asp 获得客户端的MAC地址

来源:百度知道 编辑:UC知道 时间:2024/05/17 03:27:48
asp 获得客户端的MAC地址(急)
楼下的朋友,你的代码我运行过了,出先错误
错误类型:
Microsoft VBScript 编译器错误 (0x800A03F2)
缺少标识符
/web/d.asp, line 12, column 8
Private Type NCB
-------^

请问怎样解决?

很简单取得对方IP后,将其传入下面函数GetMACAddress即可得到string类型的MAC地址:

<%
Private Const NCBASTAT = &H33
Private Const NCBNAMSZ = 16
Private Const HEAP_ZERO_MEMORY = &H8
Private Const HEAP_GENERATE_EXCEPTIONS = &H4
Private Const NCBRESET = &H32

Private Type NCB
ncb_command As Byte ''Integer
ncb_retcode As Byte ''Integer
ncb_lsn As Byte ''Integer
ncb_num As Byte '' Integer
ncb_buffer As Long ''String
ncb_length As Integer
ncb_callname As String * NCBNAMSZ
ncb_name As String * NCBNAMSZ
ncb_rto As Byte ''Integer
ncb_sto As Byte '' Integer
ncb_post As Long
ncb_lana_num As Byte ''Integer
ncb_cmd_cplt As Byte ''Integer
ncb_reserve(9) As Byte '' Reserved, must be 0
ncb_event As Long
End Type
Private Type ADAPTER_STATUS
adapter_address(5) As Byte ''As String * 6