I am sending SNMP SystemName query to local host and in response i m getting little square characters instead of the specific system name.. - Imports System.Text
-
-
Class Form1
-
-
Dim commlength As Integer, miblength As Integer, datatype As Integer, datalength As Integer, datastart As Integer
-
Dim uptime As Integer
-
Dim output As String
-
Dim conn As New SNMP()
-
Dim response As Byte() = New Byte(1023) {}
-
'Public Shared Sub Main(ByVal argv As String())
-
'End Sub
-
-
-
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
-
IPaddress.Text = "115.186.115.188"
-
Community.Text = "public"
-
-
End Sub
-
-
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
-
-
ListBox1.Items.Add("Device SNMP information:")
-
-
' Send sysName SNMP request
-
response = conn.[get]("get", IPaddress.Text, Community.Text, "1.3.6.1.2.1.1.5.0")
-
If response(0) = &HFF Then
-
ListBox1.Items.Add("No response from " & IPaddress.Text)
-
Return
-
End If
-
-
' If response, get the community name and MIB lengths
-
commlength = Convert.ToInt16(response(6))
-
miblength = Convert.ToInt16(response(23 + commlength))
-
-
' Extract the MIB data from the SNMP response
-
datatype = Convert.ToInt16(response(24 + commlength + miblength))
-
datalength = Convert.ToInt16(response(25 + commlength + miblength))
-
datastart = 26 + commlength + miblength
-
output = Encoding.ASCII.GetString(response, datastart, datalength)
-
ListBox1.Items.Add(" sysName - Datatype:" & datatype & "," & output)
And this is the output m getting
Device SNMP Information:
sysName - Datatype: 48, [][][][]
1 2485
I don't know what SNMP is but are you sure the data is ASCII encoded? Those square boxes that are displayed are usually because the data contains undisplayable characters. This means one of two things, either it uses a different character encoding scheme or the data is binary. In the former case, you will have to use the correct encoding. In the latter case, you should display it as hex.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: alcesteatxmissiondot |
last post by:
I have a table with a couple of TEXT columns. In one of them, there are
characters that aren't supported by the application and don't seem to be
able to display in the Query Analyzer either. I...
|
by: Andrew |
last post by:
Hi,
I have a form set up which collects details and then when submitted it
creates a new record in a table called rbh_vacancies
Most of the time it adds the records perfectly, but there seems...
|
by: Steve |
last post by:
Hello,
I'm running into a problems with a non-ascii "character" in a text
string. Im parsing character by character and all lines end with ascii
13 & 10 (Carriage return & newline). I'm encoding...
|
by: Jean |
last post by:
Hi all,
I have a function in VB that reads values in a text file on my hard
drive, and returns the value read as a String.
However, when I check the value in the locals window of the VBE, it...
|
by: MLH |
last post by:
The text below was cut 'n past from an HTML file.
When I pasted it into a text field of an Access 97
table, it looked different than it does below.
Below, you can see that the first 3 lines have...
|
by: JSM |
last post by:
Hi,
I am just trying to port an existing simple encryption routine to C#. this
routine simply adds/substracts 10 ascii characters to each character in a
text file (except quotes). The routine...
|
by: Jerry |
last post by:
Getting the Width of a Text in Web
Like this:
dim x as integer
len = GetTheLength("MyBlaBla")
I try to do it this way with a Label but after a view thimes runnig the
|
by: brian |
last post by:
I am building a form and need for the customer to be able
to enter a return character. Does ASP.NET have a control
that is similiar to the HTML TEXTAREA control? Or is
there another control that...
|
by: abcd |
last post by:
I have a wxTextCtrl:
wx.TextCtrl(self.myPanel, -1, "", style=wx.TE_MULTILINE)
I take a set of text (65,000 characters), and paste it into the text
control. all looks well. Then when I click...
|
by: jyck91 |
last post by:
i have done the magic square:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define SIZE 13
main()
{
FILE *fp;
int i, j, n, row, column;
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
| |