Click to See Complete Forum and Search --> : Password Input "*"
Vlatko
Feb 23rd, 2001, 06:43 AM
How to make the input by the user to appear as "*" and not the actual letters (it is a password input). And how to read the entered value.
Note: This is a 16 bit DOS application.
Thanks!!
parksie
Feb 23rd, 2001, 01:52 PM
I don't have a 16-bit compiler so I can't code anything up, but what about just hooking the keyboard?
Vlatko
Feb 23rd, 2001, 02:12 PM
I never programmed in 16 bit enviroments (DOS). SO could you explain how to hook the keyboard.
I wrote this for a password program.
void GetPass(char *input, int length, char output)
{
char temp;
for(int i = 0; i < length;)
{
temp = getch();
if(temp == 13 && i > 0)
{
input[i] = 0;
break;
}
if(i > 0)
{
if(temp == 8)
{
putchar(8);
putchar(' ');
putchar(8);
input[--i] = 0;
}
}
if(temp != 8 && temp != 13)
{
putchar(output);
input[i] = temp;
i++;
}
}
}
Vlatko, where did you get your 16b DOS compiler? I would be very interested in it.
Vlatko
Feb 23rd, 2001, 07:25 PM
Thanks Chimpface i'll give it a try.
The compiler is Turbo C++ 3.0. I have it on a CD i bought yesterday along with other 16 and 32 bit compilers.
I would send it but i am on 33600bps and the TC++ 3.0 is 12MB so..
TC3 is 16b?
Cool, I've got that :D
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.