473,404 Members | 2,178 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

VB.NET SNMP example

I am looking a VB.NET example on how to reference the SNMP API information.
I am unable to add references to SNMPAPI.LIB or SNMPAPI.DLL.

My goal is to write a 100% VB.NET example (no C or C# code) of some simple
snmp commands. All examples I can find are written in C or C#. There is an
extensive snmp.h file, but I cannot find the equivalent for VB or figure out
how to manually create the equivalent in VB

All I need is a starting point. For example - successfull compilation with
all references resolved to call the SnmpMgrOpen function

Jul 21 '05 #1
5 17151
My question is not really about SNMP as it is about properly referencing an
object. For example, if I have the following VB code

Dim lpMgrSession As Long
Dim lpAgentAddress As String
Dim lpAgentCommunity As String
Dim nTimeOut As Long
Dim nRetries As Long
lpMgrSession = SnmpMgrOpen(lpAgentAddress, lpAgentCommunity,
nTimeOut, nRetries)

I get the following error when I try to run

Name 'SnmpMgrOpen' is not declared.

The documentation indicates that the function is in MGMTAPI.DLL. My
challenge is that I have been unable to add this DLL as a reference. If I go
to Project/add reference and attempt to add under any of the tabs - .NET,
COM, or Projects, I get an error stating "This is not a valid assembly of COM
component"

What do I need to do in order to get VB.NET to understand how to call this
function?

"mony" wrote:
I am looking a VB.NET example on how to reference the SNMP API information.
I am unable to add references to SNMPAPI.LIB or SNMPAPI.DLL.

My goal is to write a 100% VB.NET example (no C or C# code) of some simple
snmp commands. All examples I can find are written in C or C#. There is an
extensive snmp.h file, but I cannot find the equivalent for VB or figure out
how to manually create the equivalent in VB

All I need is a starting point. For example - successfull compilation with
all references resolved to call the SnmpMgrOpen function

Jul 21 '05 #2
You said that you found references for how to do this in C#, right? C# is
just managed code, just like VB.Net. The reference mechanism works exactly
the same way. Follow the directions you found for C# for adding a
reference.

It is best not to try to jump from C to VB.Net. That's not so easy to do.

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
"mony" <mo**@discussions.microsoft.com> wrote in message
news:3B**********************************@microsof t.com...
My question is not really about SNMP as it is about properly referencing
an
object. For example, if I have the following VB code

Dim lpMgrSession As Long
Dim lpAgentAddress As String
Dim lpAgentCommunity As String
Dim nTimeOut As Long
Dim nRetries As Long
lpMgrSession = SnmpMgrOpen(lpAgentAddress, lpAgentCommunity,
nTimeOut, nRetries)

I get the following error when I try to run

Name 'SnmpMgrOpen' is not declared.

The documentation indicates that the function is in MGMTAPI.DLL. My
challenge is that I have been unable to add this DLL as a reference. If I
go
to Project/add reference and attempt to add under any of the tabs - .NET,
COM, or Projects, I get an error stating "This is not a valid assembly of
COM
component"

What do I need to do in order to get VB.NET to understand how to call this
function?

"mony" wrote:
I am looking a VB.NET example on how to reference the SNMP API
information.
I am unable to add references to SNMPAPI.LIB or SNMPAPI.DLL.

My goal is to write a 100% VB.NET example (no C or C# code) of some
simple
snmp commands. All examples I can find are written in C or C#. There is
an
extensive snmp.h file, but I cannot find the equivalent for VB or figure
out
how to manually create the equivalent in VB

All I need is a starting point. For example - successfull compilation
with
all references resolved to call the SnmpMgrOpen function

Jul 21 '05 #3
The c code I want to emulate is very simple:

#include <snmp.h>
#include <mgmtapi.h>

I can't include the .h files in VB and I cannot figure out out to properly
reference the fucntion call that is in a specific library. I know this
shoudl be something simple, but I can't figure it out.

"Nick Malik [Microsoft]" wrote:
You said that you found references for how to do this in C#, right? C# is
just managed code, just like VB.Net. The reference mechanism works exactly
the same way. Follow the directions you found for C# for adding a
reference.

It is best not to try to jump from C to VB.Net. That's not so easy to do.

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
"mony" <mo**@discussions.microsoft.com> wrote in message
news:3B**********************************@microsof t.com...
My question is not really about SNMP as it is about properly referencing
an
object. For example, if I have the following VB code

Dim lpMgrSession As Long
Dim lpAgentAddress As String
Dim lpAgentCommunity As String
Dim nTimeOut As Long
Dim nRetries As Long
lpMgrSession = SnmpMgrOpen(lpAgentAddress, lpAgentCommunity,
nTimeOut, nRetries)

I get the following error when I try to run

Name 'SnmpMgrOpen' is not declared.

The documentation indicates that the function is in MGMTAPI.DLL. My
challenge is that I have been unable to add this DLL as a reference. If I
go
to Project/add reference and attempt to add under any of the tabs - .NET,
COM, or Projects, I get an error stating "This is not a valid assembly of
COM
component"

What do I need to do in order to get VB.NET to understand how to call this
function?

"mony" wrote:
I am looking a VB.NET example on how to reference the SNMP API
information.
I am unable to add references to SNMPAPI.LIB or SNMPAPI.DLL.

My goal is to write a 100% VB.NET example (no C or C# code) of some
simple
snmp commands. All examples I can find are written in C or C#. There is
an
extensive snmp.h file, but I cannot find the equivalent for VB or figure
out
how to manually create the equivalent in VB

All I need is a starting point. For example - successfull compilation
with
all references resolved to call the SnmpMgrOpen function


Jul 21 '05 #4
I haven't used it, but here's a .NET SNMP library. I don't know which link
contains the latest version of the library.

http://www.c-sharpcorner.com/Code/2002/Sept/SnmpLib.asp
http://www.csharphelp.com/archives2/archive380.html

Hope this helps,

Richard Rosenheim

"mony" <mo**@discussions.microsoft.com> wrote in message
news:39**********************************@microsof t.com...
The c code I want to emulate is very simple:

#include <snmp.h>
#include <mgmtapi.h>

I can't include the .h files in VB and I cannot figure out out to properly
reference the fucntion call that is in a specific library. I know this
shoudl be something simple, but I can't figure it out.

"Nick Malik [Microsoft]" wrote:
You said that you found references for how to do this in C#, right? C# is just managed code, just like VB.Net. The reference mechanism works exactly the same way. Follow the directions you found for C# for adding a
reference.

It is best not to try to jump from C to VB.Net. That's not so easy to do.
--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
"mony" <mo**@discussions.microsoft.com> wrote in message
news:3B**********************************@microsof t.com...
My question is not really about SNMP as it is about properly referencing an
object. For example, if I have the following VB code

Dim lpMgrSession As Long
Dim lpAgentAddress As String
Dim lpAgentCommunity As String
Dim nTimeOut As Long
Dim nRetries As Long
lpMgrSession = SnmpMgrOpen(lpAgentAddress, lpAgentCommunity,
nTimeOut, nRetries)

I get the following error when I try to run

Name 'SnmpMgrOpen' is not declared.

The documentation indicates that the function is in MGMTAPI.DLL. My
challenge is that I have been unable to add this DLL as a reference. If I go
to Project/add reference and attempt to add under any of the tabs - ..NET, COM, or Projects, I get an error stating "This is not a valid assembly of COM
component"

What do I need to do in order to get VB.NET to understand how to call this function?

"mony" wrote:

> I am looking a VB.NET example on how to reference the SNMP API
> information.
> I am unable to add references to SNMPAPI.LIB or SNMPAPI.DLL.
>
> My goal is to write a 100% VB.NET example (no C or C# code) of some
> simple
> snmp commands. All examples I can find are written in C or C#. There is> an
> extensive snmp.h file, but I cannot find the equivalent for VB or figure> out
> how to manually create the equivalent in VB
>
> All I need is a starting point. For example - successfull compilation> with
> all references resolved to call the SnmpMgrOpen function
>


Jul 21 '05 #5
Your original post said: " All examples I can find are written in C or C#.
"

I would suggest that you refer to an example written in C#.
The include that you mention below is from C, not C#. These are
dramatically different languages.
They are NOT interchangable.

Once again, I suggest that you use the C# examples to start with.

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
"mony" <mo**@discussions.microsoft.com> wrote in message
news:39**********************************@microsof t.com...
The c code I want to emulate is very simple:

#include <snmp.h>
#include <mgmtapi.h>

I can't include the .h files in VB and I cannot figure out out to properly
reference the fucntion call that is in a specific library. I know this
shoudl be something simple, but I can't figure it out.

"Nick Malik [Microsoft]" wrote:
You said that you found references for how to do this in C#, right? C#
is
just managed code, just like VB.Net. The reference mechanism works
exactly
the same way. Follow the directions you found for C# for adding a
reference.

It is best not to try to jump from C to VB.Net. That's not so easy to
do.

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
"mony" <mo**@discussions.microsoft.com> wrote in message
news:3B**********************************@microsof t.com...
> My question is not really about SNMP as it is about properly
> referencing
> an
> object. For example, if I have the following VB code
>
> Dim lpMgrSession As Long
> Dim lpAgentAddress As String
> Dim lpAgentCommunity As String
> Dim nTimeOut As Long
> Dim nRetries As Long
> lpMgrSession = SnmpMgrOpen(lpAgentAddress, lpAgentCommunity,
> nTimeOut, nRetries)
>
> I get the following error when I try to run
>
> Name 'SnmpMgrOpen' is not declared.
>
> The documentation indicates that the function is in MGMTAPI.DLL. My
> challenge is that I have been unable to add this DLL as a reference.
> If I
> go
> to Project/add reference and attempt to add under any of the tabs -
> .NET,
> COM, or Projects, I get an error stating "This is not a valid assembly
> of
> COM
> component"
>
> What do I need to do in order to get VB.NET to understand how to call
> this
> function?
>
> "mony" wrote:
>
>> I am looking a VB.NET example on how to reference the SNMP API
>> information.
>> I am unable to add references to SNMPAPI.LIB or SNMPAPI.DLL.
>>
>> My goal is to write a 100% VB.NET example (no C or C# code) of some
>> simple
>> snmp commands. All examples I can find are written in C or C#. There
>> is
>> an
>> extensive snmp.h file, but I cannot find the equivalent for VB or
>> figure
>> out
>> how to manually create the equivalent in VB
>>
>> All I need is a starting point. For example - successfull compilation
>> with
>> all references resolved to call the SnmpMgrOpen function
>>


Jul 21 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Gionni | last post by:
Hello everyone, I have to send a snmp trap. I have a snmp manager (Openview) and I have started the Windows agent. Now I don't know what to do anymore. I believe I have to use the snmpapi.dll,...
10
by: Matthew Bell | last post by:
Hi, I'm looking for a high-performance SNMP manager toolkit (SNMPv1 / v2, GET / GETNEXT / GETBULK) I can use with Python on Windows2K/XP. I wonder if anyone has got any suggestions? Commercial...
1
by: dan byers | last post by:
hey everyone, i'm working on a system to monitor devices through SNMP. i'm using the Net::SNMP modules by D.Town. i try to load the snmp session request with a set of OIDs to make the system...
3
by: Kevin Ingram | last post by:
Is it possible to connect to devices and read SNMP data with ASP? I did a search and all I could find was utilities for sale to do it, wondered if it can be done using straight ASP. We are using...
1
by: ZacBowling | last post by:
Does anyone have an idea of how to access the SNMP API or WMI SNMP provider in C#/.NET? I need to query a Ascend MAX's SNMP service with a custom MIB in .NET. I won't be modify anything on the MAX...
2
by: TiToine | last post by:
Hi, I'am using the SnmpMgrOpen() api function. ####################################################################### LPSNMP_MGR_SESSION SnmpMgrOpen( LPSTR lpAgentAddress, // name and...
5
by: mony | last post by:
I am looking a VB.NET example on how to reference the SNMP API information. I am unable to add references to SNMPAPI.LIB or SNMPAPI.DLL. My goal is to write a 100% VB.NET example (no C or C#...
1
by: Dirk Van de moortel | last post by:
{ OOPS, posted this to moderated group perl.cpan.discuss as well, so it can take a while to get through, if it gets through at all Otherwise sorry for duplicate posting } We need to set up a...
7
by: moon1 | last post by:
how will I change the code the 1st code according to the 2nd one? 1st code sub snmpGet(@) { # Assign arguments my ($deviceName)=$_; # Device name to read from my...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.