473,587 Members | 2,516 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3768
I believe this is acquired from RASAPI.

The method is RasGetConnectio nStatistics ...

[DllImport("rasa pi32.dll", CharSet=CharSet .Auto, SetLastError=tr ue)]
static extern uint RasGetConnectio nStatistics(Int Ptr hRasConn, ref RAS_STATS
lpStatistics);

[StructLayout(La youtKind.Sequen tial, 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 dwHardwareOverr unErr;
public int dwFramingErr;
public int dwBufferOverrun Err;
public int dwCompressionRa tioIn;
public int dwCompressionRa tioOut;
public int dwBps;
public int dwConnectionDur ation;
}
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******** ******@TK2MSFTN GP05.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******** ********@TK2MSF TNGP03.phx.gbl. ..
I believe this is acquired from RASAPI.

The method is RasGetConnectio nStatistics ...

[DllImport("rasa pi32.dll", CharSet=CharSet .Auto, SetLastError=tr ue)]
static extern uint RasGetConnectio nStatistics(Int Ptr hRasConn, ref
RAS_STATS lpStatistics);

[StructLayout(La youtKind.Sequen tial, 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 dwHardwareOverr unErr;
public int dwFramingErr;
public int dwBufferOverrun Err;
public int dwCompressionRa tioIn;
public int dwCompressionRa tioOut;
public int dwBps;
public int dwConnectionDur ation;
}
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******** ******@TK2MSFTN GP05.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******** ******@TK2MSFTN GP04.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******** ********@TK2MSF TNGP03.phx.gbl. ..
I believe this is acquired from RASAPI.

The method is RasGetConnectio nStatistics ...

[DllImport("rasa pi32.dll", CharSet=CharSet .Auto, SetLastError=tr ue)]
static extern uint RasGetConnectio nStatistics(Int Ptr hRasConn, ref
RAS_STATS lpStatistics);

[StructLayout(La youtKind.Sequen tial, 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 dwHardwareOverr unErr;
public int dwFramingErr;
public int dwBufferOverrun Err;
public int dwCompressionRa tioIn;
public int dwCompressionRa tioOut;
public int dwBps;
public int dwConnectionDur ation;
}
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******** ******@TK2MSFTN GP05.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
3673
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 problem, and I'm at a loss. Formating is not an option ATM, and i dont know it would happen any differently next time around anyway. Suggestions would...
1
1615
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 windows service, so the application is run every 30min through a scheduled task. When the email is received the received time is ok, but the sent...
13
2415
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 how many bytes are actually sent. I can detect abort of the script using a shutdown handler. In the shutdown handler, I tried ob_get_length, but...
20
5371
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
2343
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. After receiving image bytes on client side, I want to form an image from received bytes and want to display that image onto the picture-box control.
8
34434
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 problem? All help will be appreciated. rongchaua.
0
4281
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 disabling or enabling the adapter). In HKEY_LOCAL_MACHINE\Comm\NdisPower insert this value to disable the adapter: <adapterNameREG_DWORD 4...
2
4683
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 that will move info to/from the server, C# socket functions gets bytes from the network, while C++ char*. So I am running in problem to make C++ to...
0
4268
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#. To use this code, simply add reference to Shell32.dll located in WINDOWS\System32 folder. Comments are wellcome! Enjoy...
0
7923
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7852
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8349
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6629
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5395
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3882
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2364
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1455
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1192
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.