CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
山寨机中的战斗机! 程序优化工程师到底对IT界有没有贡献
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  专题开发/技术/项目 >  网络通信

提问

楼主tsf_PB(少飞)2002-05-29 15:50:36 在 专题开发/技术/项目 / 网络通信 提问

怎么实现windows2000中   “本地联接   状态”的功能  
  他可检测到网卡的传送字节数,  
  他好像是由network   monitor   driver   实现的  
   
  问题点数:100、回复次数:5Top

1 楼xuying()回复于 2002-05-29 15:59:40 得分 0

可以用iphlp   API实现。pIfTable中有网卡状态和流入流出字节数的信息。  
   
   
  DWORD   GetIfTable(  
      PMIB_IFTABLE   pIfTable,     //   buffer   for   interface   table    
      PULONG   pdwSize,                   //   size   of   buffer  
      BOOL   bOrder                           //   sort   the   table   by   index?  
  );  
  Parameters  
  pIfTable    
  [out]   Pointer   to   a   buffer   that   receives   the   interface   table   as   a   MIB_IFTABLE   structure.    
  pdwSize    
  [in,   out]   On   input,   specifies   the   size   of   the   buffer   pointed   to   by   the   pIfTable   parameter.    
  On   output,   if   the   buffer   is   not   large   enough   to   hold   the   returned   interface   table,   the   function   sets   this   parameter   equal   to   the   required   buffer   size.    
   
  bOrder    
  [in]   Specifies   whether   the   returned   interface   table   should   be   sorted   in   ascending   order   by   interface   index.   If   this   parameter   is   TRUE,   the   table   is   sorted.    
  Return   Values  
  If   the   function   succeeds,   the   return   value   is   NO_ERROR.  
   
  If   the   function   fails,   use   FormatMessage   to   obtain   the   message   string   for   the   returned   error.  
   
  Top

2 楼tsf_PB(少飞)回复于 2002-05-29 16:05:20 得分 0

其实我是想得到网卡所有交换的数据,不是字节数  
  Top

3 楼xuying()回复于 2002-05-29 16:16:31 得分 100

那可以用setsockopt设置so_recvall选项,看<windows网络编程>第9章,有例子。  
  或者用winpcap。  
   
  http://winpcap.polito.itTop

4 楼westwf(北星之光)回复于 2002-05-29 16:31:23 得分 0

呵呵。。。。。。。。。  
  可以自己写个NDIS过滤驱动,微软DDK的NDIS例子部分有现成的。Top

5 楼FY_njim(FLY)回复于 2002-05-29 21:30:24 得分 0

学习Top

相关问题

  • 提问提问...
  • 提问
  • 提问!!
  • 提问!
  • 提问,^_^&
  • 提问 :
  • 提问
  • 提问
  • 提问
  • 提问???

关键词

  • piftable
  • 字节数
  • 网卡
  • buffer
  • interface
  • 实现
  • sorted
  • parameter
  • table
  • size

得分解答快速导航

  • 帖主:tsf_PB
  • xuying

相关链接

  • CSDN Blog
  • 技术文档
  • 代码下载
  • 第二书店
  • 读书频道

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
北京创新乐知广告有限公司 版权所有, 京 ICP 证 070598 号
世纪乐知(北京)网络技术有限公司 提供技术支持
Copyright © 2000-2008, CSDN.NET, All Rights Reserved
GongshangLogo