Visual Basic (Declaration) | |
---|---|
Public Property Version As SnmpVersion |
Visual Basic (Usage) | ![]() |
---|---|
Dim instance As MessageBase Dim value As SnmpVersion instance.Version = value value = instance.Version |
C# | |
---|---|
public SnmpVersion Version {get; set;} |
Managed Extensions for C++ | |
---|---|
public: __property SnmpVersion get_Version(); public: __property void set_Version( SnmpVersion value ); |
C++/CLI | |
---|---|
public: property SnmpVersion Version { SnmpVersion get(); void set ( SnmpVersion value); } |
Property Value
This value is initialized when a message is decoded. The application can set this property to indicate the SNMP version to be used for encoding.Exception | Description |
---|---|
System.ArgumentException | An invalid version is being specified for the message. |
Messages of type TrapMessage can only be set to SnmpVersion.One.
Messages of type InformMessage, GetBulkMessage, ReportMessage and NotificationMessage can only be set to SnmpVersion.Two or SnmpVersion.Three.
Messages of type ResponseMessage, SetMessage, GetMessage and GetNextMessage can be set to any value.
If set to SnmpVersion.Three then StandardMessage.Security should be initialized to the security values needed to control the authentication and encryption process while encoding. When decoding SnmpVersion.Three packets the Agent and Manager get their passwords from the Users property.
Target Platforms: Microsoft .NET Framework 2.0