I believe this is acquired from RASAPI.
The method is RasGetConnectionStatistics ...
[DllImport("rasapi32.dll", CharSet=CharSet.Auto, SetLastError=true)]
static extern uint RasGetConnectionStatistics(IntPtr hRasConn, ref
RAS_STATS lpStatistics);
[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Auto)]
struct RAS_STATS
{
public int dwSize;
public int dwBytesXmited;
public int dwBytesRcved;
public int dwFramesXmited;
public int dwFramesRcved;
public int dwCrcErr;
public int dwTimeoutErr;
public int dwAlignmentErr;
public int dwHardwareOverrunErr;
public int dwFramingErr;
public int dwBufferOverrunErr;
public int dwCompressionRatioIn;
public int dwCompressionRatioOut;
public int dwBps;
public int dwConnectionDuration;
}
http://www.codeproject.com/aspnet/webdialup.asp includes a wrapper for
this functionality ...
Cheers,
Greg Young
And I got my blog post for the day ... been a while since I played with
RasAPI
Ricardo said:
Can anyone help me to get the information given if you open the status
box of your internet connection? It gives connection speed, duration,
bytes sent, and bytes received.Is there some way to read this information
from performancelog?thankyou