QB64.org Forum
Active Forums => QB64 Discussion => Topic started by: Pete on September 03, 2021, 01:53:13 pm
-
I found a way to pass my ftp username and password automatically through cURL, and connect with my server, but before that, I was dealing with a password prompt at the command line, which seemed like a minor issue, until I noticed I was not able to type to the console! I tried it in a straight command prompt window, too, with no shell call, and again, no way to type it into the command prompt, either. Both the QB64 generated console and the command prompt would accept the Enter key and the usual ctrl + c to break the connection, but no typed characters would appear above the input cursor. Even though I won't be needing this "enter password" method anymore, I'm still curious if there was something I missed that would have allowed me to type or paste the password to the screen.
Pete
-
_DEST _CONSOLE and _SOURCE _CONSOLE
-
Well, that works as in the wiki for input:
INPUT "Enter your name: ", nme$
'get program input
_DEST 0 'destination program window
But if you replace the INPUT statement with...
SHELL "wget --user=myurl --ask-password ftp://myurl@www.myurl.com"
The program prompts for a password, but won't allow typed characters. When you press Enter, it advances, but naturally returns an error 530, password incorrect.
Besides, the same thing happens with just using the command prompt as an administrator. The password prompt appears in the command prompt window, but won't accept typed characters, just ctrl + c to break or Enter.
Weird...
Pete
-
Pete, what's wrong with this ?
Input "Enter your name: ", nme$
'get program input
-
HI JACK! - Hey, let me go!... Argh, that's the last time I switch on mobile speech to text while flying commercial. Anyway...
Check the thread again, and you'll see I mentioned nothing is wrong with typing when using the INPUT statement, but when I use SHELL and get prompted for my password, the console refuses to accept typed characters. Enter works and ctrl + c (for break) are accepted, but absolutely nothing shows when typing characters.
Example:
out$
= "c:\wget\wget --user=mywebsite --ask-password ftp://mywebsite@www.mywebsite.com"
It's the same with cURL, so it's not just wget, and it's the same problem if I input...
c:\wget\wget --user=mywebsite --ask-password ftp://mywebsite@www.mywebsite.com
...directly into the command window, running as administrator.
Thankfully, I found the correct syntax to automatically connect with my user name and password, and I did successfully upload a file. So while I don't need a solution for this situation, I'm still curious as to why a password prompt that shows: password for user 'mysite.com': _ won't accept typed characters to the input line.
Anyone who has wget, just change the path to wget in the code, and give it a try.
Pete