Re: Telnet and Visual Foxpro - WeOnlyDo Discussion board

Re: Telnet and Visual Foxpro (General questions)

by woddrazen, Thursday, January 11, 2007, 21:25 (6524 days ago) @ jtrogdon

Hi,


Please try something like this in VisualFoxPro_
[code]
Private Sub SSHD1_LoginPassword(ByVal User As wodSSHDComLIB.ISSHUser, ByVal Login As String, ByVal Password As String, Action As wodSSHDComLIB.SSHActions)
Action = Allow
End Sub

Private Sub SSHD1_ServiceStart(ByVal User As wodSSHDComLIB.ISSHUser, ByVal ServiceIndex As Long, ByVal ServiceType As wodSSHDComLIB.SSHServiceTypes, ByVal ServiceName As String)
User.Send 1. Border Scanning & vbCrLf
User.Send 2. Bottom Scanning & vbCrLf
User.Send 3. Panel Scanning & vbCrLf
User.Send 4. Label Scanning & vbCrLf
User.Send 5. Build-Up Scanning & vbCrLf
User.Send 6. Print Report & vbCrLf

SendPrompt User
End Sub

Private Sub SendPrompt(ByVal User As wodSSHDComLIB.ISSHUser)
User.Send vbCrLf & vbCrLf & command>
End Sub

Private Sub SSHD1_ServiceRequest(ByVal User As wodSSHDComLIB.ISSHUser, ByVal ServiceIndex As Long, ServiceType As wodSSHDComLIB.SSHServiceTypes, ServicePath As String, Action As wodSSHDComLIB.SSHActions)
ServiceType = stNone
End Sub

Private Sub SSHD1_Received(ByVal User As wodSSHDComLIB.ISSHUser, ByVal ServiceIndex As Long, ByVal BytesCount As Long)
Dim a As String
Dim i As Integer

a = User.Receive
User.Send a
User.Tag = User.Tag + a
i = InStr(1, User.Tag, Chr$(13))
If (i < 1) Then i = InStr(1, User.Tag, Chr$(10))
If i > 0 Then
a = LCase$(Left$(User.Tag, i - 1))
User.Send vbCrLf

Select Case a
Case 1
User.Send You have choose Border Scanning
Case 2
User.Send You have choose Bottom Scanning
Case 3
User.Send You have choose Panel Scanning
Case 4
User.Send You have choose Label Scanning
Case 5
User.Send You have choose Build-Up Scanning
Case 6
User.Send You have choose Print Report
Case exit
User.Send Bye!
User.Disconnect
Exit Sub

Case
' do nothing

Case Else
User.Send Invalid command!
End Select

User.Tag =
SendPrompt User
End If
End Sub
[/code]

Let us know how it goes.


Regards,
Drazen


Complete thread: