SiteLimits.MaxBandwidth Property

Definition

Gets or sets the maximum network bandwidth, in bytes per second, used for IIS 7.

public:
 property long MaxBandwidth { long get(); void set(long value); };
public long MaxBandwidth { get; set; }
member this.MaxBandwidth : int64 with get, set
Public Property MaxBandwidth As Long

Property Value

A valid value from MinValue through MaxValue. The default is 4294967295.

Exceptions

The value is less than MinValue or greater than MaxValue.

Examples

The following example checks the value of the MaxBandwidth property. If the property value is less than 100000, the example resets MaxBandwidth to 4294967295. This code example is part of a larger example provided for the SiteLimits class.

// Check the maximum bandwidth. If <100000 reset to 4294967295.
if (site.Limits.MaxBandwidth < 100000)
{
    site.Limits.MaxBandwidth = 4294967295;
    dirty = true;
}

Remarks

You can use the MaxBandwidth property to help prevent overloading a network with IIS 7 traffic.

A valid property value is from 1024 through 4294967295.

You can see and modify the MaxBandwidth property in the Advanced Settings dialog box in IIS Manager.

When you set the MaxBandwidth property, you need to call the Microsoft.Web.Administration.ServerManager.CommitChanges method to persist the change to the ApplicationHost.config file.

Applies to