Back to product page

Send method


Sends string expression to the user.

Type

None

Syntax

  • Basic
object.Send Text, [ServiceIndex]    
The Send(object,Text,ServiceIndex) syntax has these parts:
objectAn expression evaluating to an object of type SSHUser.
TextRequired. A String value. Text that will be sent to the user.
ServiceIndexOptional. A Variant value. Index of the service you're sending data to.

Remarks

Send method is used to send arbitrary text data to connected user at any time, if applicable. You can use it to create random 'chat sessions' with the user, or to send specific information to the user.

Send method becomes valid after ServiceStart event is fired for particular service. It can be used only if Service is set to stNone, stShell or stExecute. Using Send method with stSubsystem or stPortForwarding can produce unexpected results and will probably cause client to receive garbled data, and finally disconnect.

ServiceIndex parameter is optional. If not set, default service is used (this is usually a shell). You can generate custom banners when someone connects to the server as easy as this (VB sample):
 
Private Sub wodSSHD1_ServiceStart(ByVal User As wodSSHDComLIB.ISSHUser, ByVal ServiceIndex As Long, ByVal ServiceType As wodSSHDComLIB.SSHServiceTypes, ByVal ServiceName As String)
 
  ' show nice message
   User.Send "#  #  #  ######  #        ####    ####   #    #  ######" & vbCrLf
   User.Send "#  #  #  #       #       #    #  #    #  ##  ##  #" & vbCrLf
   User.Send "#  #  #  #####   #       #       #    #  # ## #  #####" & vbCrLf
   User.Send "#  #  #  #       #       #       #    #  #    #  #" & vbCrLf
   User.Send "#  #  #  #       #       #    #  #    #  #    #  #" & vbCrLf
   User.Send " ## ##   ######  ######   ####    ####   #    #  ######" & vbCrLf  
   User.Send vbCrLf & "You have connected to wodSSHD server. Feel free to stay." & vbCrLf & vbCrLf
   User.Send "You are coming from host " & User.RemoteIP & vbCrLf
   User.Send "Your login is " & User.Login & vbCrLf
   User.Send "You connected at " & Format(User.TimeConnected, "dddd, mmm d yyyy h:m") & vbCrLf
   User.Send "So far you have received " & User.BytesDownload & " bytes"
   User.Disconnect ' this isn't really very nice from us
End Sub
 


Platforms

Windows