visual basic error in referencing SNMP class
I have created an SNMP class
And then i want to test this class,so I create a program which imports this class…
Imports SNMPClass
Module Module1
End Module
Public Class SimpleSNMP
Public Sub Main(ByVal argv As String())
Dim commlength As Integer, miblength As Integer, datatype As Integer, datalength As Integer, datastart As Integer
Dim uptime As Integer = 0
Dim output As String
Dim response As Byte() = New Byte(1023) {}
Dim conn As New SNMP()
Console.WriteLine("Device SNMP information:")
' Send sysName SNMP request
response = conn.[get]("get", argv(0), argv(1), "1.3.6.1.2.1.1.5.0")
If response(0) = &HFF Then
Co开发者_运维技巧nsole.WriteLine("No response from {0}", argv(0))
Return
End If
............
I got an error in this line
Dim conn As New SNMP()
Which says “SNMPClass.SNMP is not accessible in this context because it is friend”..
I m using Visual Studio 2008
While I don't have all of your code to verify this is the case, I believe the following article from Microsoft about this error will address your issue:
http://support.microsoft.com/kb/814319
精彩评论