Welcome to Dream.In.Code
Become a C++ Expert!

Join 137,262 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,507 people online right now. Registration is fast and FREE... Join Now!




Seeing ***'s when typing PASS

2 Pages V  1 2 >  
Reply to this topicStart new topic

Seeing ***'s when typing PASS, How to::

Rating  5
ihatepikingnames
5 Nov, 2006 - 03:52 PM
Post #1

D.I.C Head
Group Icon

Joined: 31 Jul, 2006
Posts: 115


Dream Kudos: 75
My Contributions
I dont want the password to be visible on screen... HOW?!

CODE

void Auth()
{
     ifstream Passfile("password.txt", ios::in);
     Passfile>>inpass;
     ifstream Userfile("username.txt", ios::in);
     Userfile>>inuser;
     system("cls");
     cout<<"USERNAME: ";
     cin>>user;
     cout<<"PASSWORD: ";
     cin>>pass;                  //RIGHTHERE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     Userfile.close();
     Passfile.close();
     if(user==inuser&&pass==inpass)
     {
     cout<<"\nHit enter to continue to members area";
     getch();
     Members();
     }
     else
     {
         cout<<"Invalid Username or Password!";
         getch();
      
         }
}

thanks in advance!
User is offlineProfile CardPM
+Quote Post

NyeNye
RE: Seeing ***'s When Typing PASS
5 Nov, 2006 - 04:58 PM
Post #2

D.I.C Head
**

Joined: 24 Sep, 2006
Posts: 248


My Contributions
just declare a statement for substituting the input variable to your desire characters...




User is offlineProfile CardPM
+Quote Post

ihatepikingnames
RE: Seeing ***'s When Typing PASS
5 Nov, 2006 - 05:05 PM
Post #3

D.I.C Head
Group Icon

Joined: 31 Jul, 2006
Posts: 115


Dream Kudos: 75
My Contributions
QUOTE(NyeNye @ 5 Nov, 2006 - 06:58 PM) *

just declare a statement for substituting the input variable to your desire characters...


yes... but how would i do that...

This post has been edited by ihatepikingnames: 5 Nov, 2006 - 05:08 PM
User is offlineProfile CardPM
+Quote Post

NyeNye
RE: Seeing ***'s When Typing PASS
5 Nov, 2006 - 05:28 PM
Post #4

D.I.C Head
**

Joined: 24 Sep, 2006
Posts: 248


My Contributions
just look around here and see what i explore

this may help you

http://www.dreamincode.net/code/snippet76.htm
User is offlineProfile CardPM
+Quote Post

ihatepikingnames
RE: Seeing ***'s When Typing PASS
5 Nov, 2006 - 05:41 PM
Post #5

D.I.C Head
Group Icon

Joined: 31 Jul, 2006
Posts: 115


Dream Kudos: 75
My Contributions
QUOTE(NyeNye @ 5 Nov, 2006 - 07:28 PM) *

just look around here and see what i explore

this may help you

http://www.dreamincode.net/code/snippet76.htm



no sorry... when you type "outlaw" the given p-word for that program... it still shows up on the screen

i mean real-time if you type a char it shows an * on the screen...
this program does not do that...

thank you though

This post has been edited by ihatepikingnames: 5 Nov, 2006 - 05:50 PM
User is offlineProfile CardPM
+Quote Post

NyeNye
RE: Seeing ***'s When Typing PASS
5 Nov, 2006 - 06:12 PM
Post #6

D.I.C Head
**

Joined: 24 Sep, 2006
Posts: 248


My Contributions
what would be your password lenght..

CODE

for (i=0; i<30; i++)              //user can input max 30 character
       {
      
       destination[i] = getch();  //will get input character from user
                   //and character remains invisible
       cout <<"*";                   //will display '*'insted of character
       if (destination[i]==13)    //until enter key pressed (enter-13)
       goto end;
       }


embed it to your program...


be carefull for declaration.....


just modify what i'm done


User is offlineProfile CardPM
+Quote Post

ihatepikingnames
RE: Seeing ***'s When Typing PASS
5 Nov, 2006 - 06:22 PM
Post #7

D.I.C Head
Group Icon

Joined: 31 Jul, 2006
Posts: 115


Dream Kudos: 75
My Contributions
Thanks you...
ill have to mess with it for awile but i got it to compile and run and it does just what i want with a few bugs...
appreciate it
biggrin.gif
User is offlineProfile CardPM
+Quote Post

NyeNye
RE: Seeing ***'s When Typing PASS
5 Nov, 2006 - 06:40 PM
Post #8

D.I.C Head
**

Joined: 24 Sep, 2006
Posts: 248


My Contributions
your welcome amigo....



User is offlineProfile CardPM
+Quote Post

Xing
RE: Seeing ***'s When Typing PASS
5 Nov, 2006 - 07:15 PM
Post #9

D.I.C Addict
Group Icon

Joined: 22 Jul, 2006
Posts: 723



Thanked: 2 times
Dream Kudos: 1575
My Contributions
QUOTE(ihatepikingnames @ 6 Nov, 2006 - 05:22 AM) *

I dont want the password to be visible on screen... HOW?!

CODE

void Auth()
{
     ifstream Passfile("password.txt", ios::in);
     Passfile>>inpass;
     ifstream Userfile("username.txt", ios::in);
     Userfile>>inuser;
     system("cls");
     cout<<"USERNAME: ";
     cin>>user;
     cout<<"PASSWORD: ";
     cin>>pass;                  //RIGHTHERE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     Userfile.close();
     Passfile.close();
     if(user==inuser&&pass==inpass)
     {
     cout<<"\nHit enter to continue to members area";
     getch();
     Members();
     }
     else
     {
         cout<<"Invalid Username or Password!";
         getch();
      
         }
}

thanks in advance!


This is not possible in any standard way. You have to give use more details like compiler and OS?

QUOTE(NyeNye @ 6 Nov, 2006 - 07:42 AM) *

what would be your password lenght..

CODE

for (i=0; i<30; i++)              //user can input max 30 character
       {
      
       destination[i] = getch();  //will get input character from user
                   //and character remains invisible
       cout <<"*";                   //will display '*'insted of character
       if (destination[i]==13)    //until enter key pressed (enter-13)
       goto end;
       }



This doesn't look like a good solution.
User is offlineProfile CardPM
+Quote Post

NyeNye
RE: Seeing ***'s When Typing PASS
5 Nov, 2006 - 08:39 PM
Post #10

D.I.C Head
**

Joined: 24 Sep, 2006
Posts: 248


My Contributions
i just give him an idea.....it is his option if he will try it..

Mr. Xing can you post your's solution to this,in pseudo code or any?

please!!

i really appreciate it...



User is offlineProfile CardPM
+Quote Post

Xing
RE: Seeing ***'s When Typing PASS
5 Nov, 2006 - 09:24 PM
Post #11

D.I.C Addict
Group Icon

Joined: 22 Jul, 2006
Posts: 723



Thanked: 2 times
Dream Kudos: 1575
My Contributions
QUOTE(NyeNye @ 6 Nov, 2006 - 10:09 AM) *
Mr. Xing can you post your's solution to this,in pseudo code or any?


Surely I can post the solution but the OP has to give the details which I have asked in earlier post.
Nye Nye, If you are looking for standard abiding code then there is none.

User is offlineProfile CardPM
+Quote Post

NyeNye
RE: Seeing ***'s When Typing PASS
5 Nov, 2006 - 09:36 PM
Post #12

D.I.C Head
**

Joined: 24 Sep, 2006
Posts: 248


My Contributions
OS: Window XP Compiler: Dev++ or MS visual c++

can you please??post it...




User is offlineProfile CardPM
+Quote Post

2 Pages V  1 2 >
Reply to this topicStart new topic
Time is now: 12/4/08 07:05PM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month