How to programmatically limit bandwidth usage of my c# application?
What you are looking for is called Bandwidth throttling And here is a good example how is this done, also review the comments to know how it is done from a client side.
You may also want to take a look at this example too, putting things in a real application
Can i write a program to limit the Internet usage to 40mb per day?
You need to monitor the network activity. One can use IPGlobalProperties class for that.
Keep in mind that the statistics are reseted each time the connection is lost so you'll have to store them somewhere.
You need to disable internet connection, see Code to enable/disable internet connectivity
Limit Bandwidth Speeds
Take a look at http://www.codeproject.com/KB/IP/MyDownloader.aspx
He's using the well known technique which can be found in Downloader.Extension\SpeedLimit
Basically, before more data is read of a stream, a check is performed on how much data has actually been read since the previous iteration . If that rate exceeds the max rate, then the read command is suspended for a very short time and the check is repeated. Most applications use this technique.
How can I programmatically limit my program's CPU usage to below 70%?
That's not your concern... It's the job of the operating system to distribute processor time between running processes. If you'd like to give other processes first crack at getting their stuff done, then simply reduce the priority of your own process by modifying the Process.PriorityClass
value for it.
See also: Windows Equivalent of ‘nice’
Related Topics
What Is the Meaning of "This" in C#
Prevent C# App from Process Kill
.Net Core 3 Yields Different Floating Point Results from Version 2.2
Why Can't I Use Interface with Explicit Operator
How to Use Acrylic Accent in Windows 10 Creators Update
Ms Chart Rectangular Annotation Width in Percent and Not Pixel
How to Validate Signature of Jwt from Jwks Without X5C
How to Partially Project a Child Object with Many Fields in Nhibernate
Error Message "Cs5001 Program Does Not Contain a Static 'Main' Method Suitable for an Entry Point"
How to Change Route to Username After Logged In
Only Primitive Types or Enumeration Types Are Supported in This Context
C# - Which Is the Best Alternative to 'Switch on Type'
Additional Setup in Visual Studio Installer Projects
The JSON Value Could Not Be Converted to System.Int32
Ordereddictionary and Dictionary