German Auf Windows Telnet Server verbinden

haufe

New Member
Licensed User
Longtime User
Hallo

ich versuche seit Tagen auf dem Windows eigenen Telnet-Server zu verbinden.

Hier mein Code:
B4X:
Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.
Dim Client As Socket


End Sub

Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.
Client.Initialize("Client")
Dim Astreams As AsyncStreams

End Sub

Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    Activity.LoadLayout("standart")
   

End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub
Sub AStreams_Error
  ToastMessageShow("fehler", True)
End Sub

Sub Client_Connected (Successful As Boolean)
If Successful = False Then
        Msgbox(LastException.Message, "Error connecting")
        Return
    End If
    Msgbox("verbunden","")
   
    Astreams.Initialize(Client.InputStream, Client.OutputStream, "AStreams")
End Sub

Sub senden(text As String)
Dim buffer() As Byte
      buffer = text.GetBytes("utf-8")
    Astreams.Write(buffer)
End Sub
Sub AStreams_NewData (Buffer() As Byte)
    Dim msg As String
    msg = BytesToString(Buffer, 0, Buffer.Length,"utf-8")
    ToastMessageShow(msg, False)
End Sub

Sub Button1_Click
Client.Connect("192.168.25.35",23,2000)
End Sub
Sub Button2_Click
        senden("user")
    senden("pw")
   
End Sub

Das verbinden funktioniert aber das Encoding muss falsch sein, der Login funktioniert nicht.
Was mach ich falsch?
Danke für die Hilfe

Gruß
 

KMatle

Expert
Licensed User
Longtime User
Top