如果我的机器是拨号上网,有没有接口可以查询到当前的流量(也就是双击系统栏中的图标出现的发送:**,接收:**)我想得到这两个数据,有没有办法,谢谢,分数不够,我另开帖子给我,或者联系我:[email protected] 我现在可用分有8893,要可以全部给.要求:当使用NAT代理其他机子上网时,流量也需要查询到.(使用NAT代理其他机子上网时,数据只经过自己的驱动发出,不上报到Windows)我来这里都不知道解决了多少,为何没一个来帮我解决呢

解决方案 »

  1.   

    RAS Configuration and Connection Information
    Applications running on Windows NT 4.0 and later versions, and Windows 95, can use the RasEnumConnections function to get information about the existing connections on the local computer. The information for each connection includes a connection handle and the name of the phone-book entry used to establish the connection. You can use the connection handle in a call to the RasGetConnectStatus function get the current status of the connection. Windows NT 4.0 and later versions provide two new functions for retrieving RAS information. Windows 95 does not support these functions. The RasEnumDevices function returns the name and type of the RAS-capable devices that are configured on the local computer. The RasConnectionNotification function specifies an event object that the system signals when a RAS connection is created or terminated. 
    用下面两个看看
    RasEnumConnections  RasGetConnectStatus
      

  2.   

    在注册表里的第五个子键中有数据(能指HKEY_DYNA_DATA\PerfStats)。它是动态更新的。 
        
    详细代码见:
      http://www.china-askpro.com/msg31/qa41.shtml  
      

  3.   

    谢谢各位,可是使用NAT代理其他机子上网时,数据只经过自己的驱动发出,不上报到Windows,所以你说的使用Windows的计数器是得到数据的.
      

  4.   

    谢谢各位,可是使用NAT代理其他机子上网时,数据只经过自己的驱动发出,不上报到Windows,所以你说的使用Windows的计数器是得到数据的
    -----------
    NAT代理也一样!
      

  5.   

    beholder() 万分感谢,你的代码是可行的,我现在给你分数,你说把,要多少
      

  6.   

    beholder() 万分感谢,你的代码是可行的,我现在给你分数,你说把,要多少你给我个E-mail,我说到做到,你要的话,我8000多分全给你:[email protected]