有没有办法设置/限制下载/上传的带宽? [英] Is there a way for us to set / limit the bandwidth of download / upload?

查看:100
本文介绍了有没有办法设置/限制下载/上传的带宽?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我检查了C#的IPv4InterfaceStatistics类,它似乎显示了网络的所有信息,包括带宽下载/上传,发送的数据包/Rcvd和局域网的速度,

在检查属性后,我发现所有属性都是GET.

有没有办法设置/限制下载/上传的带宽?

在此先感谢.
谢谢

i have check IPv4InterfaceStatistics Class of C# and its seems it display all Information of your Network, from bandwidth download / upload, Packet Sent / Rcvd, and Speed of your LAN,

Upon checking the properties, i have found out that all of the properties are GET only.

Is there a way for us to set / limit the bandwidth of download / upload?

thanks in advance.
Thanks

推荐答案

对于所有正在执行数据传输的应用程序还是您自己的应用程序?

对于所有应用程序,不,没有设置限制此设置. Theere是执行此操作的两种方法.第一种是将代理/防火墙服务器放在客户端计算机与其目标服务器之间,该服务器具有限制带宽的功能.

第二个方法是编写一个插入到网络堆栈中的驱动程序,以完成相同的工作.这不能用C#轻松编写,并且坦率地说,您还是不希望将.NET Framework的全部功能添加到内核中.通常,您将为此工作使用C/C ++.

仅对于您的应用程序,您将需要编写发送代码以适应自身的需求,仅偶尔发送少量突发数据.

坦白说,如今,我看不到限制带宽的意义.
For all applications or just your own that is doing some transferring of data??

For all applications, no, there is no setting to limit this. Theere are two ways of doing this. The first would be to put a proxy/firewall server between the client machine and its destination server, which has the capability of throttling bandwidth.

The second would be to write a driver that is inserted into the network stack that does the same job. This cannot be easily written in C# and, frankly, you don''t want the full weight of the .NET Framework added to the kernel anyway. You would normally use C/C++ for this job.

For only your application, you would need to write your sending code to pace itself, only sending data in small bursts once in a while.

Frankly, now-a-days, I don''t see the point in limiting bandwidth.


这篇关于有没有办法设置/限制下载/上传的带宽?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆