473,568 Members | 3,190 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 17170
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 lpAgentCommunit y As String
Dim nTimeOut As Long
Dim nRetries As Long
lpMgrSession = SnmpMgrOpen(lpA gentAddress, lpAgentCommunit y,
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**@discussio ns.microsoft.co m> wrote in message
news:3B******** *************** ***********@mic rosoft.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 lpAgentCommunit y As String
Dim nTimeOut As Long
Dim nRetries As Long
lpMgrSession = SnmpMgrOpen(lpA gentAddress, lpAgentCommunit y,
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**@discussio ns.microsoft.co m> wrote in message
news:3B******** *************** ***********@mic rosoft.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 lpAgentCommunit y As String
Dim nTimeOut As Long
Dim nRetries As Long
lpMgrSession = SnmpMgrOpen(lpA gentAddress, lpAgentCommunit y,
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**@discussio ns.microsoft.co m> wrote in message
news:39******** *************** ***********@mic rosoft.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**@discussio ns.microsoft.co m> wrote in message
news:3B******** *************** ***********@mic rosoft.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 lpAgentCommunit y As String
Dim nTimeOut As Long
Dim nRetries As Long
lpMgrSession = SnmpMgrOpen(lpA gentAddress, lpAgentCommunit y,
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**@discussio ns.microsoft.co m> wrote in message
news:39******** *************** ***********@mic rosoft.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**@discussio ns.microsoft.co m> wrote in message
news:3B******** *************** ***********@mic rosoft.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 lpAgentCommunit y As String
> Dim nTimeOut As Long
> Dim nRetries As Long
> lpMgrSession = SnmpMgrOpen(lpA gentAddress, lpAgentCommunit y,
> 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
4626
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, but I can't find any reference to this library. I need a little example, could you help me? I'm sorry, but I am not a snmp expert (and I have just...
10
10014
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 software is fine, as it's for a specialised in-house application. I've tried PySNMP which, while a fine piece of code (I've learnt a lot looking...
1
3980
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 run through the large set of queries faster. the problem i'm seeing is that if the request method does the request, and one particular index...
3
5310
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 InterDev 6, IIS5 on W2KServer. Thanks!
1
532
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 (even though a SET isn't anymore difficult then a GET or a WALK I don't think).
2
3242
by: TiToine | last post by:
Hi, I'am using the SnmpMgrOpen() api function. ####################################################################### LPSNMP_MGR_SESSION SnmpMgrOpen( LPSTR lpAgentAddress, // name and address of target SNMP agent LPSTR lpAgentCommunity, // community for target SNMP agent INT nTimeOut, // communication time-out in...
5
1630
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# 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...
1
4147
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 server 2003 (or a win XP system) to accept and act upon traps sent out from a storage system. Responding to various error conditions, this system can...
7
3515
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 ($community)=$_; # SNMP Community String my ($timeout)=$_; # Timeout value for SNMP-GET request my ($type)=$_; # SNMP Object Type
0
7601
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7913
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8117
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6274
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5496
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5217
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3651
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3631
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2099
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.