472,354 Members | 2,006 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,354 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 16908
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...
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...
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...
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...
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...
2
by: TiToine | last post by:
Hi, I'am using the SnmpMgrOpen() api function. ####################################################################### LPSNMP_MGR_SESSION...
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...
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...
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)=$_; ...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python...

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.