html5中文学习网

您的位置: 首页?>?网站及特效实例?>?jquery特效 ? 正文

如何通过VB获取网卡地址_编程语言综合

[ ] 已经帮助:人解决问题

?  1)在Visual Basic生成标准的EXE文件。缺省创建 Form1。DsJHTML5中文学习网 - HTML5先行者学习网

  2)在Form1中添加一命令按钮,缺省名为Command1。DsJHTML5中文学习网 - HTML5先行者学习网

  3)把下列代码放到Form1中说明部分。DsJHTML5中文学习网 - HTML5先行者学习网

  Option ExplicitDsJHTML5中文学习网 - HTML5先行者学习网

  Private Const NCBASTAT = &H33DsJHTML5中文学习网 - HTML5先行者学习网

  Private Const NCBNAMSZ = 16DsJHTML5中文学习网 - HTML5先行者学习网

  Private Const HEAP_ZERO_MEMORY = &H8DsJHTML5中文学习网 - HTML5先行者学习网

  Private Const HEAP_GENERATE_EXCEPTIONS = &H4DsJHTML5中文学习网 - HTML5先行者学习网

  Private Const NCBRESET = &H32DsJHTML5中文学习网 - HTML5先行者学习网

  Private Type NCBDsJHTML5中文学习网 - HTML5先行者学习网

  ncb_command As Byte 'IntegerDsJHTML5中文学习网 - HTML5先行者学习网

  ncb_retcode As Byte 'IntegerDsJHTML5中文学习网 - HTML5先行者学习网

  ncb_lsn As Byte 'IntegerDsJHTML5中文学习网 - HTML5先行者学习网

  ncb_num As Byte ' IntegerDsJHTML5中文学习网 - HTML5先行者学习网

  ncb_buffer As Long 'StringDsJHTML5中文学习网 - HTML5先行者学习网

  ncb_length As IntegerDsJHTML5中文学习网 - HTML5先行者学习网

  ncb_callname As String * NCBNAMSZDsJHTML5中文学习网 - HTML5先行者学习网

  ncb_name As String * NCBNAMSZDsJHTML5中文学习网 - HTML5先行者学习网

  ncb_rto As Byte 'IntegerDsJHTML5中文学习网 - HTML5先行者学习网

  ncb_sto As Byte ' IntegerDsJHTML5中文学习网 - HTML5先行者学习网

  ncb_post As LongDsJHTML5中文学习网 - HTML5先行者学习网

  ncb_lana_num As Byte 'IntegerDsJHTML5中文学习网 - HTML5先行者学习网

  ncb_cmd_cplt As Byte 'IntegerDsJHTML5中文学习网 - HTML5先行者学习网

  ncb_reserve(9) As Byte ' Reserved, must be 0DsJHTML5中文学习网 - HTML5先行者学习网

  ncb_event As LongDsJHTML5中文学习网 - HTML5先行者学习网

  End TypeDsJHTML5中文学习网 - HTML5先行者学习网

  Private Type ADAPTER_STATUSDsJHTML5中文学习网 - HTML5先行者学习网

  adapter_address(5) As Byte 'As String * 6DsJHTML5中文学习网 - HTML5先行者学习网

  rev_major As Byte 'IntegerDsJHTML5中文学习网 - HTML5先行者学习网

  reserved0 As Byte 'IntegerDsJHTML5中文学习网 - HTML5先行者学习网

  adapter_type As Byte 'IntegerDsJHTML5中文学习网 - HTML5先行者学习网

  rev_minor As Byte 'IntegerDsJHTML5中文学习网 - HTML5先行者学习网

  duration As IntegerDsJHTML5中文学习网 - HTML5先行者学习网

  frmr_recv As IntegerDsJHTML5中文学习网 - HTML5先行者学习网

  frmr_xmit As IntegerDsJHTML5中文学习网 - HTML5先行者学习网

  if rame_recv_err As IntegerDsJHTML5中文学习网 - HTML5先行者学习网

  xmit_aborts As IntegerDsJHTML5中文学习网 - HTML5先行者学习网

  xmit_success As LongDsJHTML5中文学习网 - HTML5先行者学习网

  recv_success As LongDsJHTML5中文学习网 - HTML5先行者学习网

  if rame_xmit_err As IntegerDsJHTML5中文学习网 - HTML5先行者学习网

  recv_buff_unavail As IntegerDsJHTML5中文学习网 - HTML5先行者学习网

  t1_timeouts As IntegerDsJHTML5中文学习网 - HTML5先行者学习网

  ti_timeouts As IntegerDsJHTML5中文学习网 - HTML5先行者学习网

  Reserved1 As LongDsJHTML5中文学习网 - HTML5先行者学习网

  free_ncbs As IntegerDsJHTML5中文学习网 - HTML5先行者学习网

  max_cfg_ncbs As IntegerDsJHTML5中文学习网 - HTML5先行者学习网

  max_ncbs As IntegerDsJHTML5中文学习网 - HTML5先行者学习网

  xmit_buf_unavail As IntegerDsJHTML5中文学习网 - HTML5先行者学习网

  max_dgram_size As IntegerDsJHTML5中文学习网 - HTML5先行者学习网

  pending_sess As IntegerDsJHTML5中文学习网 - HTML5先行者学习网

  max_cfg_sess As IntegerDsJHTML5中文学习网 - HTML5先行者学习网

  max_sess As IntegerDsJHTML5中文学习网 - HTML5先行者学习网

  max_sess_pkt_size As IntegerDsJHTML5中文学习网 - HTML5先行者学习网

  name_count As IntegerDsJHTML5中文学习网 - HTML5先行者学习网

  End TypeDsJHTML5中文学习网 - HTML5先行者学习网

  Private Type NAME_BUFFERDsJHTML5中文学习网 - HTML5先行者学习网

  name As String * NCBNAMSZDsJHTML5中文学习网 - HTML5先行者学习网

  name_num As IntegerDsJHTML5中文学习网 - HTML5先行者学习网

  name_flags As IntegerDsJHTML5中文学习网 - HTML5先行者学习网

  End TypeDsJHTML5中文学习网 - HTML5先行者学习网

  Private Type ASTATDsJHTML5中文学习网 - HTML5先行者学习网

  adapt As ADAPTER_STATUSDsJHTML5中文学习网 - HTML5先行者学习网

  NameBuff(30) As NAME_BUFFERDsJHTML5中文学习网 - HTML5先行者学习网

  End TypeDsJHTML5中文学习网 - HTML5先行者学习网

  Private Declare Function Netbios Lib "netapi32.dll" (pncb As NCB) As ByteDsJHTML5中文学习网 - HTML5先行者学习网

  Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (hpvDest As Any, ByVal hpvSource As Long, ByVal cbCopy As Long)DsJHTML5中文学习网 - HTML5先行者学习网

  Private Declare Function GetProcessHeap Lib "kernel32" () As LongDsJHTML5中文学习网 - HTML5先行者学习网

  Private Declare Function HeapAlloc Lib "kernel32" (ByVal hHeap As Long, ByVal dwFlags As Long, ByVal dwBytes As Long) As LongDsJHTML5中文学习网 - HTML5先行者学习网

  Private Declare Function HeapFree Lib "kernel32" (ByVal hHeap As Long,ByVal dwFlags As Long, lpMem As Any) As LongDsJHTML5中文学习网 - HTML5先行者学习网

  把下面的代码放入Command1_Click的事件中:DsJHTML5中文学习网 - HTML5先行者学习网

  Private Sub Command1_Click()DsJHTML5中文学习网 - HTML5先行者学习网

  Dim myNcb As NCBDsJHTML5中文学习网 - HTML5先行者学习网

  Dim bRet As ByteDsJHTML5中文学习网 - HTML5先行者学习网

  myNcb.ncb_command = NCBRESETDsJHTML5中文学习网 - HTML5先行者学习网

  bRet = Netbios(myNcb)DsJHTML5中文学习网 - HTML5先行者学习网

  myNcb.ncb_command = NCBASTATDsJHTML5中文学习网 - HTML5先行者学习网

  myNcb.ncb_lana_num = 0DsJHTML5中文学习网 - HTML5先行者学习网

  myNcb.ncb_callname = "* "DsJHTML5中文学习网 - HTML5先行者学习网

  Dim myASTAT As ASTAT, tempASTAT As ASTATDsJHTML5中文学习网 - HTML5先行者学习网

  Dim pASTAT As LongDsJHTML5中文学习网 - HTML5先行者学习网

  myNcb.ncb_length = Len(myASTAT)DsJHTML5中文学习网 - HTML5先行者学习网

  Debug.Print Err.LastDllErrorDsJHTML5中文学习网 - HTML5先行者学习网

  pASTAT = HeapAlloc(GetProcessHeap(), HEAP_GENERATE_EXCEPTIONS or HEAP_ZERO_MEMORY, myNcb.ncb_length)DsJHTML5中文学习网 - HTML5先行者学习网

  If pASTAT = 0 ThenDsJHTML5中文学习网 - HTML5先行者学习网

  Debug.Print "memory allcoation failed!"DsJHTML5中文学习网 - HTML5先行者学习网

  Exit SubDsJHTML5中文学习网 - HTML5先行者学习网

  End IfDsJHTML5中文学习网 - HTML5先行者学习网

  myNcb.ncb_buffer = pASTATDsJHTML5中文学习网 - HTML5先行者学习网

  bRet = Netbios(myNcb)DsJHTML5中文学习网 - HTML5先行者学习网

  Debug.Print Err.LastDllErrorDsJHTML5中文学习网 - HTML5先行者学习网

  CopyMemory myASTAT, myNcb.ncb_buffer, Len(myASTAT)DsJHTML5中文学习网 - HTML5先行者学习网

  MsgBox Hex(myASTAT.adapt.adapter_address(0)) & " " & Hex(myASTAT.adapt.adapter_address(1)) _DsJHTML5中文学习网 - HTML5先行者学习网

  & " " & Hex(myASTAT.adapt.adapter_address(2)) & " " _DsJHTML5中文学习网 - HTML5先行者学习网

  & Hex(myASTAT.adapt.adapter_address(3)) _DsJHTML5中文学习网 - HTML5先行者学习网

  & " " & Hex(myASTAT.adapt.adapter_address(4)) & " " _DsJHTML5中文学习网 - HTML5先行者学习网

  & Hex(myASTAT.adapt.adapter_address(5))DsJHTML5中文学习网 - HTML5先行者学习网

  HeapFree GetProcessHeap(), 0, pASTATDsJHTML5中文学习网 - HTML5先行者学习网

  End SuDsJHTML5中文学习网 - HTML5先行者学习网

  5)点击Command1。注意,网卡地址将在一信息框中显示出来。DsJHTML5中文学习网 - HTML5先行者学习网

(责任编辑:)
推荐书籍
推荐资讯
关于HTML5先行者 - 联系我们 - 广告服务 - 友情链接 - 网站地图 - 版权声明 - 人才招聘 - 帮助