See Also

Agent Class  | Agent Members  | Overload List

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

message
An instance of a ResponseMessage, ReportMessage, TrapMessage, or NotifyMessage.
remoteHost
The name or IP address (in dot notation) of the intended recipient SNMP manager.
See Also Languages PowerSNMP for .NET

Send(Message,String) Method

Dart.PowerSNMP Namespace > Agent Class > Send Method : Send(Message,String) Method

Send a message to the SNMP manager specified.

[Visual Basic]
Overloads Public Function Send( _    ByVal message As Message, _    ByVal remoteHost As String _ ) As Integer
[C#]
public int Send(    Message message,    string remoteHost );
[C++]
public: int Send(    Message* message,    string* remoteHost )
[C++/CLI]
public: int Send(    Message^ message,    String^ remoteHost )

Parameters

message
An instance of a ResponseMessage, ReportMessage, TrapMessage, or NotifyMessage.
remoteHost
The name or IP address (in dot notation) of the intended recipient SNMP manager.

Exceptions

ExceptionDescription
SocketExceptionA problem was experienced using network resources.
InvalidOperationExceptionThe provided message parameter is not a ResponseMessage, Report Message, TrapMessage, or NotifyMessage

Example

The following example demonstrates sending a trap message with the Agent component.

[Visual Basic] 


Try
    'Create Trap Message
    Dim trap As TrapMessage = New Dart.PowerSNMP.Trap.warmStart
    Agent1.Send(trap, "Dart-IBM-Host")
Catch ex As Exception
    ShowError(ex.Message)
End Try

[C#] 


try
{
   
// Create and Send a Trap Message
   
TrapMessage trap = new Dart.PowerSNMP.Trap.warmStart();
   agent1.Send(trap,
"Dart-IBM-Host");
}
catch (Exception ex)
{
   ShowError(ex.Message);
}

                

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  | Overload List


Send comments on this topic.

Documentation version 1.2.0.0.

© 2008 Dart Communications.  All rights reserved.