Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9193119
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T21:05:07+00:00 2026-06-17T21:05:07+00:00

I want to measure the bandwidth networking by process in my C# Application. I’ve

  • 0

I want to measure the bandwidth networking by process in my C# Application.

I’ve try to find this information in the Process Object, but, this information not exist.

I’ve try too to use Performance Counter, but I don’t find the bandwidth information by process.

Have you an idea for measures the Network Banding ( network bytes send, network bytes received) by process for application work on Windows XP to Windows 8 ?

I know Windows have this information, because when we open the “resources monitor”, I can select a specific application in the Network Tab, and we can see the number of bytes send and received in real time.

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T21:05:12+00:00Added an answer on June 17, 2026 at 9:05 pm

    As far as I know you cannot do this with pure C# you will have to make some P/Invoke calls into the IP Helper library.

    Because this is quite involved I’m going to briefly outline the API calls you’ll need to make.

    Firstly, this will not work on Windows XP as some of the API are new (which is why Resource Monitor doesn’t exist for that version). If you need Windows XP support you’re going to have to use something like WinPCap I’m afraid. On Vista+ things get better with the newer network information calls we get to make.

    There are separate calls for IPv4, IPv6, TCP and UDP. For brevity I’ll just outline the IPv4/TCP set as once you understand the process it can easily be replicated to fill in the other parts.

    To start you’ll need to call GetTcpTable2(). This gets you the table of connections currently active on the machine. You’ll end up with a MIB_TCPTABLE2 and a bunch of MIB_TCPROW2 structures. Each structure represents a connection.

    The MIB_TCPROW2 structure has a PID field which you can match to your current process ID.

    So that means continually polling for the connection table, iterate it and dump out the rows relating to your process.

    For each of these rows you will then have to call GetPerTcpConnectionEStats(). There’s two stat types you will be interested in, the first TcpConnectionEstatsData returns information on the number of bytes sent and received. The second TcpConnectionEstatsBandwidth returns information on the bandwidth of the connection.

    The reason I haven’t shown any code for this is that its quite involved and involves a lot of structure marshaling, but hopefully I have given you more to go on than you currently have.

    Here are links to MSDN for those functions:

    GetTcpTable2() – http://msdn.microsoft.com/en-us/library/bb408406(v=vs.85).aspx
    GetPerTcpConnectionEStats() – http://msdn.microsoft.com/en-us/library/bb485738(v=vs.85).aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is the algorithm, but when I want to measure the execution time it
I have developed an application and I want to measure how much network bandwidth
I want to measure time memory allocation using this code: long AForMemory = DateTime.Now.Ticks;
I want to measure the size of a text in JavaScript. So far this
I want to measure the performance and scalability of my DB application. I am
I want to measure memory usage for each thread within process. Is it possible?
I want to measure/optimize the "cold boot" startup performance of an application, and it's
I have an algorithm and I want to measure the time it works, but
I want to measure how long it takes to process AJAX call. I have
I have a simple enough web application. I want to measure for any day

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.