SmiTypeExtensionsDecode Method |
Decodes the provided SNMP data into a human-readable string representation based on the specified SMI type.
Namespace: Lextm.SharpSnmpPro.MibAssembly: SharpSnmpPro.Mib (in SharpSnmpPro.Mib.dll) Version: 2.1.3+8c6e8963be682b1d7fd7055c260d7b3d449dbc11
Syntaxpublic static string Decode(
this ISmiType type,
ISnmpData data
)
<ExtensionAttribute>
Public Shared Function Decode (
type As ISmiType,
data As ISnmpData
) As String
Dim type As ISmiType
Dim data As ISnmpData
Dim returnValue As String
returnValue = type.Decode(data)
public:
[ExtensionAttribute]
static String^ Decode(
ISmiType^ type,
ISnmpData^ data
)
[<ExtensionAttribute>]
static member Decode :
type : ISmiType *
data : ISnmpData -> string
Parameters
- type ISmiType
- The SMI type used to interpret and decode the SNMP data. Must implement ISmiType.
- data ISnmpData
- The SNMP data to decode. Cannot be .
Return Value
StringA string representation of the decoded SNMP data. If the data matches a named number in the SMI type, the
result includes the name and value (e.g., "Name(123)"). Otherwise, the raw string representation of the data
is returned.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
ISmiType. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
Exceptions
RemarksThis method uses the SMI type hierarchy to decode the data. If the type is a derived
type, the method attempts to retrieve a decoder from the
DecoderRegistry. If the type is a
basic type, it verifies the data and decodes it accordingly. Named numbers in integer types are resolved to
their corresponding names if available.
See Also