Click here to Skip to main content
12,550,111 members (44,757 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as


13 bookmarked

Use WINSNMP and VB.Net 2005 to retrieve SNMP information.

, 18 Mar 2008 CPOL
Rate this:
Please Sign up or sign in to vote.
Make a get call via the WINSNMP API to retrieve the os version from a remote machine.


VBDNFW2SNMP is a quick attempt to use the winsnmp api to retrieve information from remote snmp agents. This example uses VB .Net 2005 with the .Net framework 2.0


Most of the examples I found on the net used WMI instead of api calls, and the older VB6 code used winsock. After many, many hours of searching and putting pieces of info together, i could finaly make a get call to a remote snmp agent. The most valuable resources were:

Microsoft platform SDK for Windows 2003 server.

WinSNMP (VB6) at Http://

check out the WinSNMP v2.0 Addendum at

Function Pointers and COM
By Ben Garcia (VB6 and C++) at

Windows SNMP - An Open Interface for Programming Network Management Applications usint the Simple Network Management Protocol under Microsoft Windows - available via FTP from host under directory /pub/micro/pc-stuff/ms-windows/WinSNMP

SNMP example in C# from Evolution software at

The rest was filled in with info from MSDN and GOOGLE

Using the code

I have included the complete project which retrieves the os version only. Simply run VBDNFW2SNMP.exe, type in the remote IP and click on the get button.

The current code does not release and cleanup SNMP objects created. It also does not retrieve all types of OID, as this part of the code has to be expanded on further. Where possible I have added the necessary error management to try and make the code easier to debug.

Points of Interest

This was a huge challenge for me as I had to use API calls and really tried to understand a bit more about interoperability between managed and unmanaged code.


First attempt :)


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Software Developer
South Africa South Africa
No Biography provided

You may also be interested in...

Comments and Discussions

Questiontrap Pin
Member 122219186-May-16 0:13
memberMember 122219186-May-16 0:13 
QuestionDoesn't seem to work on Windows 7 Pin
Ben Freeman CBNL15-Jan-14 22:50
memberBen Freeman CBNL15-Jan-14 22:50 
AnswerRe: Doesn't seem to work on Windows 7 Pin
Member 1168193915-May-15 13:56
memberMember 1168193915-May-15 13:56 
GeneralMy vote of 5 Pin
lizhaoqian721-Mar-13 0:13
memberlizhaoqian721-Mar-13 0:13 
Question"SNMP error description: No operation performed " using VBDNFW2SNMP Pin
foca1729-Apr-10 22:39
memberfoca1729-Apr-10 22:39 
Hi guys, I'm trying to use VBDNFW2SNMP but when I try to get some information the message "SNMP error description:No operation performed on VBDNFW2SNMP" appear.

Could you have a solution about that issue?

Thanks a lot

AnswerRe: "SNMP error description: No operation performed " using VBDNFW2SNMP Pin
Member 872935714-Mar-12 9:39
memberMember 872935714-Mar-12 9:39 
GeneralOpen source 100% .NET SNMP library Pin
lextm9-Sep-08 20:27
memberlextm9-Sep-08 20:27 
GeneralI don´t get OS version Pin
Andybestlc9-May-08 12:42
memberAndybestlc9-May-08 12:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.161021.1 | Last Updated 18 Mar 2008
Article Copyright 2008 by JuanPieterse
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid