|
-
Sep 26th, 2005, 11:31 PM
#1
Thread Starter
Lively Member
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.
-
Sep 26th, 2005, 11:41 PM
#2
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
-
Sep 26th, 2005, 11:44 PM
#3
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:
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.
-
Sep 26th, 2005, 11:50 PM
#4
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:
Option Explicit
Private Sub Form_Load()
Text1.Text = ""
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
MsgBox KeyAscii
End Sub
EDIT: Took too long to test and look it up
Last edited by dglienna; Sep 26th, 2005 at 11:53 PM.
-
Sep 27th, 2005, 01:44 AM
#5
Thread Starter
Lively Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|