all groups > dotnet general > april 2006 >
You're in the

dotnet general

group:

bytes sent and received from network adapter



Re: bytes sent and received from network adapter Greg Young [MVP]
4/26/2006 5:56:19 PM
dotnet general: 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 :)







[quoted text, click to view]

bytes sent and received from network adapter Ricardo
4/26/2006 6:24:39 PM

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

Re: bytes sent and received from network adapter Ricardo
4/27/2006 11:17:35 AM
Thanks a lot Greg!!!

Is there a way to get this measures when you´re broadband connected??
Over PPPoE connection for example?

thanks again


"Greg Young [MVP]" <DruckDruckGoose@hotmail.com> escreveu na mensagem
news:%23WdqFxXaGHA.4248@TK2MSFTNGP03.phx.gbl...
[quoted text, click to view]

Re: bytes sent and received from network adapter Greg Young [MVP]
4/27/2006 6:29:44 PM
It works with any windows connection (dial up, VPN, etc)

Cheers,

Greg
[quoted text, click to view]

AddThis Social Bookmark Button