470,874 Members | 1,470 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,874 developers. It's quick & easy.

bytes sent and received from network adapter


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
Apr 26 '06 #1
3 3512
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" <ri*****@fundep.br> wrote in message
news:uf**************@TK2MSFTNGP05.phx.gbl...

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

Apr 26 '06 #2
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]" <Dr*************@hotmail.com> escreveu na mensagem
news:%2****************@TK2MSFTNGP03.phx.gbl...
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" <ri*****@fundep.br> wrote in message
news:uf**************@TK2MSFTNGP05.phx.gbl...

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


Apr 27 '06 #3
It works with any windows connection (dial up, VPN, etc)

Cheers,

Greg
"Ricardo" <ri*****@fundep.br> wrote in message
news:OV**************@TK2MSFTNGP04.phx.gbl...
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]" <Dr*************@hotmail.com> escreveu na mensagem
news:%2****************@TK2MSFTNGP03.phx.gbl...
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" <ri*****@fundep.br> wrote in message
news:uf**************@TK2MSFTNGP05.phx.gbl...

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



Apr 27 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by bonokoot | last post: by
13 posts views Thread by Shailesh Humbad | last post: by
8 posts views Thread by rongchaua | last post: by
2 posts views Thread by jackmejia | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.