http://www.vchelp.net/article/ras_speed.htm

解决方案 »

  1.   

    to Kevin_qing(Kevin)
    这篇文章中说的总接收,总发送,每秒接收,每秒发送
    这四个数值我都能得到。我想得到的是modem和ISP端的握手速度
    比如是26.4K、33.6K或51.2K速度连接。
      

  2.   

    连接速率吗?2000下面可以用
    RasGetConnectionStatistics();
    参数RAS_STATS::dwBps 就是了
      

  3.   

    我大概搞错了,看看这个:
    http://www.codetools.com/internet/rasman.aspCRasConnection::m_dwConnectionSpeedResThe connection speed in bits per second for this connection. Please note that this value is always reported as 0 on NT as currently there is no documented way of retrieving this value on NT.  Another point to bear in mind is that on 95/98, this is the accumulated connection speed of all current RAS connections. This means that if you are using multilink features or have two separate RAS connections active at the one time, then this value will be the total of both connections. 
      

  4.   

    to Kevin_qing(Kevin)
    #include "ras.h"
    RAS_STATS rasstats;
    怎么程序报告说error C2065: 'RAS_STATS' : undeclared identifier
    可我看MSDN,RAS_STATS的头文件就是Ras.h啊
    这是怎么回事呢?
    请指点
      

  5.   

    你的platform sdk的头文件不够新。
    另外还应该定义winntver为0x500,以使用2000的函数
      

  6.   

    to Kevin_qing(Kevin)和ahphone(阿丰)
    通过TAPI或RAS能得到modem握手后的速度吗?(这个速度是指初始连结速度,不是
    时实的速度)
      

  7.   

    RasGetConnectionStatistics()得到的就是连接速率啊。
    可惜只能在2000上面用
      

  8.   

    to Kevin_qing(Kevin):
    但是就象我上面说的
    在vc里我用这个函数的时候会编译不过去
    很奇怪的是我已经include了ras.h
    而我打开ras.h的确没有发现RasGetConnectionStatistics()
    难道是msdn写错了???
      

  9.   

    你的platform sdk的头文件不够新。还不支持2000的函数
      

  10.   

    用SNMP试试看或者用IP helper API可以查PPP adapter设备的状态,可以得到速率
      

  11.   

    to Kevin_qing(Kevin)
    那我去装一个新的SDK就可以了是吗?
      

  12.   

    或者可以手动调用API
    LoadLibrary()
    GetProcAddress()
    需要自己把RAS_STATS的结构声名一下
      

  13.   

    多谢Kevin_qing(Kevin)指点
    我大概已经知道该怎么做了
    :)