Results 1 to 5 of 5

Thread: Sending Control F+Control G via Winsock

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2000
    Location
    Philippines
    Posts
    85

    Sending Control F+Control G via Winsock

    Hi to all!

    I'm trying to establish connection in a cisco router which is connected to a switching equipment using reverse telnet. The problem lies upon connection, for me to be prompted by <PLEASE ENTER USER ID by the system I must send Control F and Control G at the same time without an enter key. I'm getting no response from the switch equipment but doing it using the command prompt and telnet it manually it is successful.
    Am i sending the correct codes for control F and control G?

    Here is the code:

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    Connect("10.4.16.193 4001") '======IP, Port
    Thread.Sleep(3000) '====wait
    'SendData(Chr(94) & Chr(70)) 'sendata
    SendData("^F")
    End Sub

    any help will be very much appreciated.

  2. #2
    Frenzied Member Phill64's Avatar
    Join Date
    Jul 2005
    Location
    Queensland, Australia
    Posts
    1,201

    Re: Sending Control F+Control G via Winsock

    perhaps it would be ^F+^G ? or ^F+G ?

    i'd say try a few different things and you're likely to get the right combination

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Sending Control F+Control G via Winsock

    You should be able to use members of the Keys enumeration and a bit-wise Or:
    VB Code:
    1. SendData(New String(New Char() {Convert.ToChar(Keys.Control Or Keys.F), Convert.ToChar(Keys.Control Or Keys.G)}))
    This will actually create Ctrl+F as a single character, and like wise for Ctrl+G.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  4. #4
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Sending Control F+Control G via Winsock

    Control-G is Chr$(6) [ACK] and Control-G is Chr$(7) [BEL]

    I used VB6 and played around with it. Control-G and Control-g are the same code.

    VB Code:
    1. Option Explicit
    2.  
    3. Private Sub Form_Load()
    4.   Text1.Text = ""
    5. End Sub
    6.  
    7. Private Sub Text1_KeyPress(KeyAscii As Integer)
    8.   MsgBox KeyAscii
    9. End Sub

    EDIT: Took too long to test and look it up
    Last edited by dglienna; Sep 26th, 2005 at 11:53 PM.

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Aug 2000
    Location
    Philippines
    Posts
    85

    Thumbs up Re: Sending Control F+Control G via Winsock

    Thanks you Guys,

    herewith are the solutions after series of code modification.

    SendData(Convert.ToChar(Chr(6))) '==ACK
    Thread.Sleep(3000)
    SendData(Convert.ToChar(Chr(7))) '==BELL

    or ===================================

    SendData(Chr(6))
    Thread.Sleep(3000)
    SendData(Chr(7))

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