ûűУֻʹSTermScriptSTermScriptҪ˵£

﷨
	STermScript.Method([arglist])


	GetSessionName()	
		ȡõǰ
	 
	GetHostAddress()
		ȡַ
	 
	GetHostPort()
		ȡ˿
	 
	GetHostProtocol()	
		ȡЭ
		ܵķֵΪ
			Const STERM_PROTOCOL_TELNET = 0
			Const STERM_PROTOCOL_SSH1 = 1
			Const STERM_PROTOCOL_SSH2 = 2

	Delay(dwMilliseconds)
		ӳdwMilliseconds
	
	GetBuffer(nLine)
		ȡĻϵĳһ(0 based index)
	 
	GetScreenWidth()
		ȡĻ
	 
	GetScreenHeight()
		ȡĻ
	 
	SendData(str)
		һַ
	 
	SendConvertedData(str)
		;תַַ^ͷĲֽᱻתɶӦascii룬"^C"תchr(3)ϸɼultraeditview->ascii table
	 
	IsConnected()
		Ƿ.
	 
	Reconnect()
		ӵ빤϶Ӧťһ
	 
	Disconnect()
		Ͽӣ빤϶Ӧťһ
	 
	GetCursorX()
		ȡùx
	 
	GetCursorY()
		ȡùy
	 
	GetSelectText()
		ȡôѡı
	 
	 
 
ӣ
	'**********************************************************************
	'* Filename: test.vbs                                                 *
	'* Author: Pred                                                       *
	'* You may freely modify or redistribute this file                    *
	'**********************************************************************
	
	Option Explicit
	Main
	MsgBox ("Script End")
	
	Sub Main()
	    Const nTimeout = 20
	
	    Dim bConnect, nTime, nScreenHeight, strScreenLine, nDelay
	
	    MsgBox ("Selection is:" + Chr(13) + STermScript.GetSelectText())
	    nTime = Timer
	    nDelay = 3000
	    While (Not STermScript.IsConnected())
	        If (Abs(Timer - nTime) > nTimeout) Then
	            Exit Sub
	        End If
	        MsgBox ("Not Connected, Let's Connect to Host")
	        STermScript.Reconnect
	        MsgBox ("Let's wait " + CStr(nDelay) + " ms")
	        STermScript.Delay nDelay
	    Wend
	
	    MsgBox ("Connected to Host, Now let's send ""AAA"" to host")
	
	    STermScript.SendData ("AAA")
	    STermScript.Delay 200
	
	    nScreenHeight = STermScript.GetScreenHeight()
	    strScreenLine = STermScript.GetBuffer(nScreenHeight - 1)
	    MsgBox ("The last line of screen is" + Chr(13) + strScreenLine)
	
	    If (MsgBox("Abort connection?", vbYesNo, "STerm Script") = vbNo) Then
	        Exit Sub
	    End If
	
	    STermScript.Disconnect
	End Sub
	
	 
