函数声明:
RasGetConnectionStatistics: Function ( // W2K only
hrasconn: HRasConn;
lpStatistics: PTRas_Stats // buffer to receive statistics
): DWORD; stdcall;
实现部分在RASAPI32.DLL中,使用的时候用GetProcAddress动态加载。
参数结构:
PTRas_Stats = ^TRas_Stats ;
TRas_Stats = Record
dwSize,
dwBytesXmited,
dwBytesRcved,
dwFramesXmited,
dwFramesRcved,
dwCrcErr,
dwTimeoutErr,
dwAlignmentErr,
dwHardwareOverrunErr,
dwFramingErr,
dwBufferOverrunErr,
dwCompressionRatioIn,
dwCompressionRatioOut,
dwBps,
dwConnectDuration: DWORD ;
end ;
使用:
var
RasStatistics: TRas_Stats;
ConnSpd: Integer;
begin
RasStatistics.dwSize := sizeof(TRas_Stats);
RasGetConnectionStatistics(fCurRASConn,@RasStatistics);
ConnSpd := RasStatistics.dwBps;
end;
只能在w2k下运行。