![]() |
Chat on IRC |
can somebody do that?
Posted by lekkie [send private reply] at September 08, 2002, 12:10:03 PM
Code 2 change ur input to a pwd.I mean when u r input it it shows **** bla bla bla.
Posted by mop [send private reply] at September 08, 2002, 12:15:44 PM
My telepathy isn't working too well right now, could you give some details?
Posted by RedX [send private reply] at September 08, 2002, 12:19:08 PM
That wouldn't be hard to implent.
A normal input (in pseudo code) would be something like DO GET char PRINT char <other stuff(if needed)> WHILE NOT done VERIFY To get a password it would be DO GET char PRINT "*" <other stuff> WHILE NOT done VERIFY I'm not 100% sure, but I think this is possible with the standard textfields (resources) in windows without much programming.
Posted by whizkide [send private reply] at September 08, 2002, 12:30:22 PM
i tried that. All you have to do is use something like this
char c while(c=getch()) {cout<<'*'; } if u wanna get a real password, ull have to use a character array where i used c. whizzzzzzzzzzzzzzzzzzzzzz
Posted by regretfuldaydreamer [send private reply] at September 08, 2002, 12:39:25 PM
depends what language you wanna use. Unfortunately his profile doesn't say what language so I can't help.
Posted by whizkide [send private reply] at September 08, 2002, 12:47:32 PM
he uses c++. at least from all his other posts. ""he is always asking c++ questions""./me laughs at lekkie
whizzzzzzzzzzzz
Posted by regretfuldaydreamer [send private reply] at September 08, 2002, 01:11:47 PM
He's only had 6 posts so he can't always be asking c++ questions. STill, his questions answered now so thats the end of this thread.
Posted by whizkide [send private reply] at September 08, 2002, 01:34:11 PM
well that's an assignment for you. Just try a little search for his posts and ull see what i mean.
whizzzzzzzzzz thread closed
Posted by unknown_lamer [send private reply] at September 08, 2002, 04:37:35 PM
What? You will still see the password on the console if the user types it in there. You have to use termios or something similar to turn off echoing on the console.
Posted by RedX [send private reply] at September 08, 2002, 04:50:52 PM
Why make it difficult? If you don't want them to see what they type, there is one choice: duct tape. (the strenght of the glue depents on how much you dislike the person.)
It's easy and it's funny.
Posted by whizkide [send private reply] at September 08, 2002, 04:53:29 PM
if u use getch(); it wont echo what you type to the screen so whe you read in a character, you print an asterix *.
it's as simple as that. whizzzzzzzzzzzzzzzz lamer, i dont get what u mean
Posted by unknown_lamer [send private reply] at September 08, 2002, 06:27:29 PM
No, it will echo to the screen because the terminal does this automatically for you unless you disable it using a terminal option. When you do std::cin.get() or something similar, your application isn't responsible for echoing the chars the user entering to stdout, the terminal is. So you have to use a terminal option to disable echoing. Termios is a library for POSIX systems that lets you control terminal options without actually knowing about the terminal (e.g. vt100, vt220, etc).
Posted by buzgub [send private reply] at September 09, 2002, 12:56:36 AM
In any case, the win32 api does have support for such shenanigans. If that's what is recquired then I'm sure lekkie will be told if [s]he clarifies the question.
Posted by unknown_lamer [send private reply] at September 09, 2002, 08:12:40 AM
Well, for a graphical application everything it different. You can (in Gtk+ and Qt at least) turn off automatic echoing in input widgets. But for text based applications you still have to turn off echoing. I think you can do that in Windows text applications using conio.
Register as a new user | ||||||||||||||||