Hi all:
I want to develop a software like a peer_to_peer application in C#.But I don't quite know how to realize some functions such as getting a peer bandwidth,throttling and showing downloading rate.
I google it ,and find a article "How to do bandwidth Throttling using C# .Net code".
But the website require you to pay for registration. :=>(
can anyone tell me how to realize those functions or offer me some samples or some webs
Thanks a lot.

How to obtain bandwidth and downloading rate
Will Merydith
Thanks all,
I'll write my code for recording download speed and bandwidth as Alan stated.
Thanks Alan specially.
Artje
Thanks ,Alan.
It is helpful to me .
But can't we just invoke the window's api to get the transfer rate
Is there have one
pessi
When sending data to another client you need send it in chunks of 1-5kB, in my application i choose 2kB chunks. Over 1 second intervals i totalled up how many chunks were sent and using that figure i calculated the average transfer rate. Then it's just a case of only sending a chunk of data when the calculated average transfer rate is less than the max allowed transfer rate.
For accurate (ish) speeds i recorded the data transferred for each second and then averaged those over 10 seconds in order to get a good average transfer rate.
Hopefully that makes sense to you.
Rudemusik
tnfemme
Also, if you are writing a P2P application, then surely you'd need to provide rate-limiting to limit the max upload and download speed. In order to implement that you're implementing at least 80% of the necessary infrastructure to record download speed yourself :p