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 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 BytePrivate Sub Form_Load()
NC = Space(30)
Text1.Text = Netbios(NC.ncb_num)'不知是不是这样调用?
End Sub
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 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 BytePrivate Sub Form_Load()
NC = Space(30)
Text1.Text = Netbios(NC.ncb_num)'不知是不是这样调用?
End Sub
解决方案 »
- 怎样用VB独立处理文本数据?最好能写代码简单点就好了~指个方向
- 如何将YUY2格式转换成YUV420格式
- 窗体保存问题
- VBA 如何判断某excel文件一共有多少行多少列?
- 我弄了个查询功能,用DBGrid显示,但结果只能看到字段名,不能看到集体数据,请帮忙看一下
- 请谈谈思路,如何编写类似webbrowser的程序对html解析/显示?
- 如何定义和使用窗体变量
- 请问用数组作为传入参数调用vb做的dll中的函数总报错?请指教,在线等待,谢谢!
- 数据库中时间的添加
- 水晶报表问题,有哪位高手能帮忙?急!!多谢了
- 如何使用DBGRID的buttonclick事件在网格上展开下拉菜单
- 关于"车干的五一"聚会的事情:)
private function ethernetaddress(lananumber as long) _
as string dim udtncb as ncb
dim bytresponse as byte
dim udtastat as astat
dim udttempastat as astat
dim lngastat as long
dim strout as string
dim x as integer udtncb.ncb_command = ncbreset
bytresponse = netbios(udtncb)
udtncb.ncb_command = ncbastat
udtncb.ncb_lana_num = lananumber
udtncb.ncb_callname = "* "
udtncb.ncb_length = len(udtastat)
lngastat = heapalloc(getprocessheap(), _
heap_generate_exceptions or heap_zero_memory, udtncb.ncb_length) 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
我运行了,但又提示dim udtastat as astat 未定义。
我用我的那个出了个结果是3,不知为何物??