PDA

Click to See Complete Forum and Search --> : [VB6] Telnet Client UserControl


dilettante
Dec 24th, 2007, 09:08 PM
You asked for it, you've got it! A Telnet UserControl that supports an asynchronous processing model.

All clean, original code. Nothing copied from... well you know those other projects! The event model is similar to that of the Winsock control itself.

The TelnetTTYClient UserControl is presented here within a simple Telnet client "TTY terminal" project. See the TelnetTTYClient.ctl and modDoc.bas source comments for more information.

You can add the TelnetTTYClient UserControl to your projects by copying TelnetTTYClient.ctl and TelnetTTYClient.ctx to your project folder and adding TelnetTTYClient.ctl to your project (Add|File... in Project Explorer).

Note that using a TTY terminal type as in the sample project can be useful in avoiding the need to parse out VTxxx escape sequences.

dilettante
Jan 11th, 2012, 09:22 AM
Minor update, will not affect most programs but may add some stability. Can mostly just drop-into any existing Projects you have. Primary difference you might see is in the Enum TTC_ERRORS, passed to your client logic via the Error event.

fotonut
Jan 31st, 2012, 05:50 PM
Nice to get a 5 year update just 2 weeks before I need it :-) What timing! Nice perfectly working model; thanks. Do you have any examples coded where this can be used to send commands to tty and "screen scrape" to get the response or is it all in here and I just need to wade through it? (I am always extremely lazy when possible :-) Also is there a way to instigate a keep alive for a 60 second time out from the server? Thanks!!!

dilettante
Jan 31st, 2012, 05:58 PM
You'd need to grab the Winsock control's socket property and use that with API calls to set KeepAlives. Maybe look at http://www.vbforums.com/showthread.php?t=457390 and dig it out of there?

Sorry, I don't have any examples that parse server response messages... that's pretty wide open since every application would be so different. The process is plain old parsing though, using Split(), and InStr(), or regex.

fotonut
Jan 31st, 2012, 06:14 PM
Will look into it, thanks.

Also I can't find any examples of communicating via SSH TTY other than with ActiveX controls that cost more than small automobiles, way out of the range of most hobbyists. Do you know of anything that has been constructed using common VB6 offerings? Thank you.

dilettante
Feb 1st, 2012, 05:08 AM
I think I understand the problem: creating a VB6 program that does much the same kind of thing but over an SSH session (not Telnet through an SSH tunnel, but Secure Shell itself).

No I haven't seen anything that does that, and yes the prices are fairly high for good (or any) SSH ActiveX components.


I do have a kind of "hillbilly" solution I have used in the past for that kind of thing as well as SFTP, FTPS, and straight FTP:

Find a free client EXE for the protocol that supports redirection of the StdIO streams. For SSH this might be PuTTY or PLink. Then I use my ShellPipe control (http://www.vbforums.com/showthread.php?t=660014) in the VB6 program to run this utility and automate it via the ShellPipe.

As always, the biggest headache is parsing the responses. Well... maybe after you get any required SSH keys configured on the client PC of course, but sometimes you can live without those keys anyway depending on the server.