Increment IP address contained in the object by specific number and return the result as a new class.

Namespace: SnmpSharpNet
Assembly: SnmpSharpNet (in SnmpSharpNet.dll) Version: 0.9.1.0 (0.9.1)

Syntax

C#
public IpAddress Increment(
	uint count
)
Visual Basic
Public Function Increment ( _
	count As UInteger _
) As IpAddress
Visual C++
public:
IpAddress^ Increment(
	unsigned int count
)

Parameters

count
Type: System..::..UInt32
Number to increment IP address with

Return Value

New class representing incremented IP address

Examples

CopyC#
IpAddress addr = new IpAddress("10.20.11.2");
Console.WriteLine("Starting IP: {0}", addr.ToString());
// Output: Starting IP: 10.20.11.2
IpAddress incrAddr1 = addr.Increment(1);
Console.WriteLine("Incremented by 1: {0}", incrAddr1.ToString());
// Output: Incremented by 1: 10.20.11.3
IpAddress incrAddr10 = addr.Increment(10);
Console.WriteLine("Incremented by 10: {0}", incrAddr10.ToString());
// Output: Incremented by 10: 10.20.11.12

See Also