strout = ""
if lngastat then
udtncb.ncb_buffer = lngastat
bytresponse = netbios(udtncb)
copymemory udtastat, udtncb.ncb_buffer, len(udtastat)
with udtastat.adapt
for x = 0 to 5
strout = strout & right$("00" & hex$(.adapter_address(x)), 2)
next x
end with
heapfree getprocessheap(), 0, lngastat
end if
ethernetaddress = strout
end function
Private Type NCB
ncb_command As Integer
ncb_retcode As Integer
ncb_lsn As Integer
ncb_num As 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 Declare Function Netbios Lib "netapi32.dll" _
(pncb As NCB) As Byte
Private Sub Form_Load()
NC = Space(30)
Text1.Text = Netbios(NC.ncb_num)'不知是不是这样调用?
End Sub