打印本文 打印本文  关闭窗口 关闭窗口  
如何通过VB获取网卡地址
作者:佚名  文章来源:不详  点击数  更新时间:2008/3/1 11:03:00  文章录入:杜斌  责任编辑:杜斌

  1)在Visual Basic生成标准的EXE文件。缺省创建 Form1。

  2)在Form1中添加一命令按钮,缺省名为Command1。

  3)把下列代码放到Form1中说明部分。

  Option Explicit

  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

打印本文 打印本文  关闭窗口 关闭窗口