EldoS | Feel safer!

Software components for data protection, secure storage and transfer

received text data with many unknown symbols

Also by EldoS: CallbackFilter
A component to monitor and control disk activity, track file and directory operations (create, read, write, rename etc.), alter file data, encrypt files, create virtual files.
#10832
Posted: 08/20/2009 01:30:17
by johnny  (Standard support level)
Joined: 08/20/2009
Posts: 19

I tried to use the SimpleSSHclient and it works fine except the format of data.

for example, with 'ls', I have below output from putty:
[root@PT4 src]# cd /usr/local/
[root@PT4 local]# ls
bin etc games include info lib libexec man sbin share src


But using SimpleSSHClient the output becomes:
[root@PT4 src]# cd /usr/local
[root@PT4 local]# ls
bin etc games include info lib libexec man sbin share src
[root@PT4 local]#


Belos are the simple codes I used to received dat a:
Private Sub Timer_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer.Tick

If client.Active Then
Try
recvbufferLen = recvBuffer.Length
recvLen = recverr.Length
client.ReceiveData(recvBuffer, recvbufferLen, recverr, recvLen)
received = System.Text.Encoding.ASCII.GetString(recvBuffer, 0, recvbufferLen)
Catch ex As Exception
End Try

If received.Length > 0 Then
tbView.Text = tbView.Text + received
End If
End If

End Sub


Anybody has any ideas?
#10833
Posted: 08/20/2009 01:35:20
by Mykola Olshevsky (Basic support level)
Joined: 07/07/2005
Posts: 450

These are escape-sequences, used to send terminal extended data (text color, cursor position and so on). And you must deal with them by yourself. They has quite simple format, so it should not be a problem to cut them out.
#10850
Posted: 08/20/2009 21:15:50
by johnny  (Standard support level)
Joined: 08/20/2009
Posts: 19

suprisingly the format is fine with some other commands like at or crontab.....

Anyway it will be good if you could post some links explaining how to remove those excape-sequences in case they appear?

thanks a lot.
#10853
Posted: 08/21/2009 01:35:20
by Mykola Olshevsky (Basic support level)
Joined: 07/07/2005
Posts: 450

Commands, which output raw text, without coloring and cursor movement, doesn't use escape sequences to their output looks fine.

You can simply found information about escape sequences in google or wikipedia, for example: http://en.wikipedia.org/wiki/ANSI_escape_sequences

Reply

Statistics

Topic viewed 961 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!