These code snippets can be copied and pasted into your project.
Samples are working applications demonstrating SNMP for .NET components in C#, VB.NET, C++/CLI and PowerShell. Source code included.
||Demonstrates responding to SNMP requests and sending trap and inform messages.
||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.
||Demonstrates receiving and processing trap messages.
||Demonstrates displaying mibs in a tree structure and on-demand mib parsing. Also demonstrates mib compilation into code files.
||Demonstrates discovering and retrieving variables supported by an agent under a specified OID.
||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
||Demonstrates a simple blocking Agent in a console application.
||Demonstrates a simple blocking trap catcher using the Manager component in a console application.
||Uses the Agent Component to build an agent as a windows service.
||Demonstrates a simple trap catcher using the Manager component in a windows service.
Applications are more sophisticated than samples and demonstrate more comprehensive functionality.
|Free SNMP Manager
||Demonstrates a fully functional SNMP Manager application. WinForms C# source.
Download SNMP Sample Projects
After downloading, you will need to unblock the zip before extracting it: locate the zip in Windows explorer, right-click on it, select 'Properties', and click the 'Unblock' button in the bottom-right corner of the General tab.
This will resolve the compile-time exception 'Could not load file or assembly 'Dart.*****' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)'.