Results 1 to 3 of 3

Thread: Sending data with winsock

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 1999
    Posts
    51
    Hello all. I'm making a simple client application that sends keystrokes to a server (it's an exchange server if anyone cares to know) everytime a key is pressed in a text box. Here is what the code looks like:

    Private Sub txtSend_KeyPress(KeyAscii As Integer)
    tcpClient.SendData Chr$(KeyAscii)
    End Sub

    Here is the problem: characters are being sent just fine, but when I press enter (code: 13) the server doesn't pick up on it. What am I doing wrong?

  2. #2
    Fanatic Member
    Join Date
    Jul 2000
    Location
    Manchester NH
    Posts
    833
    If its a microsoft box you need to send a chr(10) too!


    Private Sub txtSend_KeyPress(KeyAscii As Integer)
    if keyascii <> 13 then
    tcpClient.SendData Chr$(KeyAscii)
    else
    tcpClient.SendData vbcrlf
    End Sub

    Kurt Simons
    [I know I'm a hack but my clients don't!]

  3. #3

    Thread Starter
    Member
    Join Date
    Oct 1999
    Posts
    51
    that worked! thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width