See Also

Agent Class  | Agent Members

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows ME, Windows 2000, Windows XP, Windows Server 2003, Windows Vista

Language

Visual Basic

C#

C++

C++/CLI

Show All

See Also Languages PowerSNMP for .NET

Variables Property

Dart.PowerSNMP Namespace > Agent Class : Variables Property (Agent)

Used to store a list of Variable objects that are used to create a default ResponseMessage for each RequestMessage received.

[Visual Basic]
<BrowsableAttribute(False)> Public Property Variables As SortedVariables
[C#]
[BrowsableAttribute(false)] public SortedVariables Variables {get; set;}
[C++]
[BrowsableAttribute(false)] public: __property SortedVariables* get_Variables(); public: __property void set_Variables(    SortedVariables* value );
[C++/CLI]
[BrowsableAttribute(false)] public: property SortedVariables^ Variables {    SortedVariables^ get();    void set (SortedVariables^ value); }

Return Type

A SortedVariables object that can be used to store Variable objects. This property is used at run-time only.

Remarks

If null, then MessageEventArgs.Response.Variables is not populated. In this case the application should either add variables to complete the response for the library to send or set MessageEventArgs.Response to null to indicate no response should be sent.

If not null, then the library will construct a default ResponseMessage using the Variable objects found. An error ResponseMessage is constructed if requested IIDs are not present.

Most agent applications will take advantage of this property by populating Variables with Variable objects so that default response messages are generated.

The ResponseMessage(RequestMessage, SortedVariables) constructor is used to generate MessageEventArgs.Response.

No sysUpTime object is required, as this value is automatically populated from Message.SysUpTime.

Example

The following example demonstrates adding a sysDescr variable to the agent's supported variables.

[Visual Basic] 


'Add the uptime variable...value with be sourced from Message.SysUpTime
Agent1.Variables.Add(New Variable(New Dart.PowerSNMP.MibObject.sysUpTime))

[C#] 


// Add the uptime variable...value with be sourced from Message.SysUpTime
agent1.Variables.Add(new Variable(new Dart.PowerSNMP.MibObject.sysUpTime()));
           
                

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows ME, Windows 2000, Windows XP, Windows Server 2003, Windows Vista

See Also

Agent Class  | Agent Members


Send comments on this topic.

Documentation version 1.2.0.0.

© 2008 Dart Communications.  All rights reserved.