Input a "password" string

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Aug 2004
Posts: 10
Reputation: hail2dthief is an unknown quantity at this point 
Solved Threads: 0
hail2dthief hail2dthief is offline Offline
Newbie Poster

Input a "password" string

 
0
  #1
Aug 26th, 2004
I :cheesy: want to input a string but instead of showing the real characters on the screen, i want all to be astericks. Can anybody help me to solve this?
Reply With Quote Quick reply to this message  
Join Date: Jun 2004
Posts: 436
Reputation: Chainsaw is an unknown quantity at this point 
Solved Threads: 10
Chainsaw's Avatar
Chainsaw Chainsaw is offline Offline
Unprevaricator

Re: Input a "password" string

 
0
  #2
Aug 27th, 2004
On a windows dialog? In VC++ you can edit the properties of an edit control and one of the properties is to use asterisks instead of text for password fields.
Reply With Quote Quick reply to this message  
Join Date: Aug 2004
Posts: 10
Reputation: hail2dthief is an unknown quantity at this point 
Solved Threads: 0
hail2dthief hail2dthief is offline Offline
Newbie Poster

Re: Input a "password" string

 
0
  #3
Aug 27th, 2004
No, not on a windows dialog. Actually i'm writing a program in dos mode and want to set up a password. Is there any c++ function that can help me to solve this?
Reply With Quote Quick reply to this message  
Join Date: Aug 2004
Posts: 18
Reputation: hfick is an unknown quantity at this point 
Solved Threads: 0
hfick hfick is offline Offline
Newbie Poster

Re: Input a "password" string

 
0
  #4
Aug 27th, 2004
tHis is just my guess but try doing.....
cout << "* ";
is that what your talking about?
Reply With Quote Quick reply to this message  
Join Date: Apr 2004
Posts: 4,343
Reputation: Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future 
Solved Threads: 237
Team Colleague
Dave Sinkula's Avatar
Dave Sinkula Dave Sinkula is offline Offline
long time no c

Re: Input a "password" string

 
0
  #5
Aug 27th, 2004
"One of the methods used by statists to destroy capitalism consists in establishing controls that tie a given industry hand and foot, making it unable to solve its problems, then declaring that freedom has failed and stronger controls are necessary." --Ayn Rand
Reply With Quote Quick reply to this message  
Join Date: Aug 2004
Posts: 10
Reputation: hail2dthief is an unknown quantity at this point 
Solved Threads: 0
hail2dthief hail2dthief is offline Offline
Newbie Poster

Re: Input a "password" string

 
0
  #6
Aug 27th, 2004
No, that's not what i'm talking about. What I want is when I enter a string, the asterisks will come out on the screen. Just like when you enter your password to log in to this website.
Reply With Quote Quick reply to this message  
Join Date: Apr 2004
Posts: 4,343
Reputation: Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future 
Solved Threads: 237
Team Colleague
Dave Sinkula's Avatar
Dave Sinkula Dave Sinkula is offline Offline
long time no c

Re: Input a "password" string

 
0
  #7
Aug 27th, 2004
Originally Posted by hail2dthief
No, that's not what i'm talking about. What I want is when I enter a string, the asterisks will come out on the screen. Just like when you enter your password to log in to this website.
Please reread the part of that link that describes exactly that.
"One of the methods used by statists to destroy capitalism consists in establishing controls that tie a given industry hand and foot, making it unable to solve its problems, then declaring that freedom has failed and stronger controls are necessary." --Ayn Rand
Reply With Quote Quick reply to this message  
Join Date: Aug 2004
Posts: 10
Reputation: hail2dthief is an unknown quantity at this point 
Solved Threads: 0
hail2dthief hail2dthief is offline Offline
Newbie Poster

Re: Input a "password" string

 
0
  #8
Aug 27th, 2004
Thanks, Dave. I'll try it out and see if it can sole the problem or not.
Reply With Quote Quick reply to this message  
Join Date: May 2004
Posts: 256
Reputation: FireNet will become famous soon enough FireNet will become famous soon enough 
Solved Threads: 6
FireNet's Avatar
FireNet FireNet is offline Offline
Posting Whiz in Training

Re: Input a "password" string

 
0
  #9
Aug 27th, 2004
  1. //Warning,written by hand.Mistakes are possible
  2.  
  3. void pass(char *s,int len,char mask='*')
  4. {
  5. int loc = 0;
  6. char p;
  7. int x = getx();
  8. int y = gety();
  9.  
  10. do
  11. {
  12. p = getch();
  13. if(p == '\r') // \r = enter
  14. {
  15. s[loc] = 0;
  16. break;
  17. }
  18. else if(p == '\b') // \b means backspace
  19. {
  20. if(loc>0)
  21. {
  22. s[loc]=0;
  23. loc--
  24. gotoxy(x-1,y);
  25. cout<<" ";
  26. gotoxy(--x,y);
  27. }
  28. }
  29. else
  30. {
  31. s[loc++] = p;
  32. x++;
  33. cout<<m;
  34. }
  35.  
  36. }
  37. while(true);
  38. }
See what you can, remember what you need

Fourzon | Earn via Coding
Reply With Quote Quick reply to this message  
Join Date: Aug 2004
Posts: 10
Reputation: hail2dthief is an unknown quantity at this point 
Solved Threads: 0
hail2dthief hail2dthief is offline Offline
Newbie Poster

Re: Input a "password" string

 
0
  #10
Aug 27th, 2004
Thanks, guys. Problem solved.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC