473,320 Members | 2,202 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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 3747
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: genetic.error | last post by:
I installed VS.NET 2003 on Windows 2000 Pro SP3. Since doing so, I have no internet connection. Also, I have no access to my home network. I've done everything I can think of to correct the...
1
by: bonokoot | last post by:
Hello, I wrote this program in C# that accesses a SQL Server database that runs a stored procedure and sents the results in an email every 30min. I wrote this as a windows application instead of a...
13
by: Shailesh Humbad | last post by:
Here is an advanced PHP question. Can anyone think of a way to detect the number of bytes written to output when a script is aborted? I am sending a large file to the client, and I want to record...
20
by: newbie | last post by:
Hi all, http://www.aswin.be/nictransfer.JPG How can I get these numbers with VB.NET ? I thought somewhere in WMI but I can't find them. Thank you, Aswin
2
by: nishi.hirve | last post by:
Hello, I am writing 1 client-server application in which I have written my server in C on linux system and client in C#. My server is sending image bytes of that image size to the client....
8
by: rongchaua | last post by:
Hi all, i would like now to disable and enable network adapter programmatically with c#. I have searched but found nothing useful. There's no topic about this problem. Has someone done with this...
0
by: BLUE | last post by:
Enable and Disable in the Network and DialUp Connections manager is actually setting a bit in the registry for the target adapter and then calling NDIS to unbind or bind (depending on whether your...
2
by: jackmejia | last post by:
Hello all. I am mostly a C# developer, and I am working on a research project which involves networking between a server written in C# and the client written in C++. I have defined a protocol...
0
by: Eran.Yasso | last post by:
Hi all, The following code sets/disables network adpter's status. Since I have no idea where to put this code and I wish to share the community with it. I did rverse engineering from VBS to C#....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.