Back to product page
- Introduction
- License agreement
- Getting Started
- Enumerations
- Objects
- wodTelnetDLX
- Methods
- Properties
- Authentication
- AutoSize
- BackColor
- BackLog
- BindIP
- BindPort
- Blocking
- BorderVisible
- Certificate
- CharEncoding
- Column
- Columns
- ColWidth
- Command
- ContextMenu
- CursorHeight
- DataOut
- DataReady
- Enabled
- ErrorText
- ExitSignal
- ExitStatus
- Font
- ForeColor
- HandleSysKeys
- Hostname
- hWnd
- KeepAlives
- Language
- LastError
- LocalCertBag
- Login
- MousePointer
- MouseWheel
- MyHostname
- MyIP
- Notification
- Password
- Picture
- Port
- Prompt
- Protocol
- ProxyHostname
- ProxyLogin
- ProxyPassword
- ProxyPort
- ProxyType
- RecordMode
- RemoteIdentification
- Row
- RowHeight
- Rows
- ScrollBars
- ScrollX
- ScrollY
- SecureMethod
- SelectedText
- ShowCursor
- Socket
- SpecialKeyFocus
- State
- StateText
- StripANSI
- StripColors
- TabStop
- TelnetOption
- TerminalEmulation
- TerminalType
- Text
- Timeout
- TranslateSpecial
- UseIPv6
- Version
- Events
- IwodTelnetNotify
- wodTelnetDLX
- How to get support?
- Technical information
- Fast notifications interface
- Error list
Prompt property
Holds command prompt string to expect from server.
Type
StringSyntax
- Basic
object.Prompt [= value]
The Prompt(object) syntax has these parts:
The Prompt(object) syntax has these parts:
object | An expression evaluating to an object of type wodTelnetDLX |
Remarks
Prompt property allows wodTelnetDLX to have 'a feature' to determine if last executed command (and it's output) finished, so new commands are to be executed. If you have more than one command to execute on remote server, you will find this feature handy. When you set this property, wodTelnetDLX will fire PromptReceived event each time it recognizes command prompt sequence.Take an example: try to connect to your server. After connection is established, you will receive something like this:
telnet some.host.com
Trying some.host.com...
Connected to 192.168.1.10.
Escape character is '^]'.
linux login: joe
Password:
Linux 2.4.5. Last login: Sat Jan 26 2002 on pts/0 from mainframe.
No mail.
joe@somehost:-$
note here that sequence joe@somehost: represents command prompt string that will be returned by server each time it expects new command. To be even more certain, you can add CRLF sequence before it. So, if you set Prompt = "joe@somehost:" then each time wodTelnetDLX finds this sequence it will fire PromptReceived event. Here, you can execute new command, and wait for it's output.
If Prompt property is set, the command prompt string you entered will not be provided through Received event - which means you don't have to 'cut it off' from command output.
You can also provide regular expression to be searched in received data instead of exact value. You should prepend your Prompt property with regex: text so wodTelnetDLX knows you are using regular expression.
For example, you can use it like this:
Telnet1.HostName = "some.host.com"
Telnet1.Login = "joe"
Telnet1.Password = "secretpass"
Telnet1.Protocol = SSHAuto
Telnet1.Prompt = "regex:[\$%#] $"
Telnet1.Connect
above regular expression will match when:
- $, %, #, or > is found
- space
- end of line
Debug.Print Telnet1.Execute("cd /tmp" & VbLf, "regex:[a-zA-z0-9]+@[a-zA-z0-9]+:[a-zA-z0-9-/]+[\$%#] $")
or using extended PERL syntax
Debug.Print Telnet1.Execute("cd /tmp" & VbLf, "regex:\w+@\w+:\S+\$ $")
just don't forget to put regex: text in front of regular expression, otherwise wodTelnetDLX will search for exact match of specified pattern. PCRE (www.pcre.org) library is used for regex support.