PowerSNMP for .NET
Available Platforms
Code Examples
These code snippets for PowerSNMP for .NET can be copied and pasted into your project.
General Examples
Code Snippet | Description |
---|---|
Non-blocking Operation | Illustrates how Dart's FTP components can be used to stream multiple files over the network. |
Logging Requests | Accepts passive connections and echoes back all data it receives over those connections. |
Logging Messages | Allows you to send a receive files between a remote computer. |
Sending Informs | Demonstrates the mechanics of connecting to an HTTP server, and sending/receiving resources from the server. |
Sending SNMPv3 Requests | Demonstrates how to make a TCP control listen for and accept HTTP requests. |
Adding SNMPv3 users | Demonstrates retrieval of mail from a POP3 mail server. |
Agent Examples
Code Snippet | Description |
---|---|
Basic Agent Operation | Starting an agent that receives and responds to SNMP queries (sets, gets, etc) |
Adding Variables to the Agent | Adding variables to an agent's Variables collection |
Responding to Requests | Responding to a Get request for a value maintained outside of Agent.Variables |
Populating a Table | Populating a specific table with a pre-defined method |
Populating a Table from an Array | Populating an arbitrary table from a 2d string array on a local agent |
Sending Traps | Sending Traps |
Sending MIB Defined Traps | Sending a Trap defined in a loaded MIB |
Manager Examples
Code Snippet | Description |
---|---|
Listening for Notifications | Listening for notifications (traps and informs), and responding to informs |
Sending a Get Request | Sending a Get request and receiving the response |
Sending a Set Request | Sending a Set request and receiving the response |
Get Request Using MibNodes | Sending a Get request for an object defined in a MIB loaded at runtime |
Get Request Using Mib Code Files | Sending a Get request for an object defined in a Mib code file |
Single-threaded Get Requests | Sending a Get request in a single-threaded application (demonstrates basics of single-threaded use) |
Discovering Agents | Discovering agents on your network with a broadcast Get request |
Sending GetNext Requests | Sending a GetNext request and receiving the response |
Sending GetBulk Requests | Sending a GetBulk request and receiving the response |
GetTable Using GetNext Requests | Getting an SNMP table using the GetTable method utilizing GetNext requests |
GetTable Using GetBulk Requests | Getting an SNMP table using the GetTable method utilizing GetBulk requests |
Populating a Table Remotely | Populating an arbitrary table from a 2d string array on a remote agent from a manager |
Walk an Agent | Walking an agent from a specified OID |
Manually Walk an Agent | Manually walk an agent using GetNext requests |
Sample Projects
Samples are working applications demonstrating SNMP for .NET components in C#, VB.NET, C++/CLI and PowerShell. Source code included. Sample Projects that include .NET Core 2.0 projects, referencing the Dart.Snmp.Standard dll, are marked with the this icon:
Sample Name | Sample Description |
---|---|
Agent | Demonstrates responding to SNMP requests and sending trap messages. |
Manager | Demonstrates getting and setting Agent variables, sending and receiving inform messages, retrieving tables, and receiving traps. |
Manager Task Async | Uses the Manager Component to build a simple manager. Supports queries for basic variables, either by discovery or specific address. Also shows how to set values. Uses GetResponseTaskAsync to retrieve variable values and send informs. |
Trap Catcher | Demonstrates receiving and processing trap messages. |
MIB Treeview | Demonstrates displaying mibs in a tree structure and on-demand mib parsing. Also demonstrates mib compilation into code files. |
MIB Walker | Demonstrates discovering and retrieving variables supported by an agent under a specified OID. |
SNMP Poll | Demonstrates simultaneous high-performance polling of numerous variables. |
Web Manager (ASP.NET) | Demonstrates getting Agent variable values in a web application. |
Web Service Manager | Demonstrates getting Agent variable values in a web service application. Includes example consumer app. |
WCF Service Manager | Demonstrates getting Agent variable values in a Windows Communication Foundation (WCF) service application. Includes example consumer app. |
WPF Simple Manager | Demonstrates using the Manager component to build a simple manager in WPF |
Agent Console ![]() |
Demonstrates a simple blocking Agent in a console application. |
Trap Console ![]() |
Demonstrates a simple blocking trap catcher using the Manager component in a console application. |
Manager Console ![]() |
Demonstrates performing a simple blocking get using the Manager component within a console application. |
Agent Service | Uses the Agent Component to build an agent as a windows service. |
Trap Service | Demonstrates a simple trap catcher using the Manager component in a windows service. |
Application Projects
Applications are more sophisticated than samples and demonstrate more comprehensive functionality.
Application Name | Application Description |
---|---|
Free SNMP Manager | Demonstrates a fully functional SNMP Manager application. WinForms C# source. |