Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Convert all characters to ' * ' where password is displayed...

Reply
Thread Tools

Convert all characters to ' * ' where password is displayed...

 
 
David
Guest
Posts: n/a
 
      02-02-2004
Hi,

I have a field from my recordset called RS("Password").
If I wish to display each character as an asterix '*' how do I go
about it.
I've seen the replace function, but cannot work out how to do it for
how ever many characters there are in the record ?


Appreciate your help



David.
 
Reply With Quote
 
 
 
 
Alex Goodey
Guest
Posts: n/a
 
      02-02-2004
For i to Len(RS("Password"))
strPass = strPass & "*"
Next

then use strPass iin your display

"David" <> wrote in message
news: om...
> Hi,
>
> I have a field from my recordset called RS("Password").
> If I wish to display each character as an asterix '*' how do I go
> about it.
> I've seen the replace function, but cannot work out how to do it for
> how ever many characters there are in the record ?
>
>
> Appreciate your help
>
>
>
> David.



 
Reply With Quote
 
 
 
 
David Gordon
Guest
Posts: n/a
 
      02-02-2004
Thanks,

I had just started to think about using For I = , but could not think
about the strPass = strPass & "*"


Nice one....Thanks



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
Evertjan.
Guest
Posts: n/a
 
      02-02-2004
Alex Goodey wrote on 02 feb 2004 in
microsoft.public.inetserver.asp.general:
> For i to Len(RS("Password"))
> strPass = strPass & "*"
> Next
>


strPass = String(Len(RS("Password")),"*")

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
 
Reply With Quote
 
Ray at
Guest
Posts: n/a
 
      02-02-2004
strPass = String(Len(strPass), "*")

What is the reason you (OP) want to do this though? Why not just use a
length of *'s that isn't specific to the length of the user's password, if
you aren't going to display it? And you're aware of <input type=password>,
right?

Ray at work


"Alex Goodey" <> wrote in message
news:bvm0u6$tujqo$...
> For i to Len(RS("Password"))
> strPass = strPass & "*"
> Next
>
> then use strPass iin your display
>
> "David" <> wrote in message
> news: om...
> > Hi,
> >
> > I have a field from my recordset called RS("Password").
> > If I wish to display each character as an asterix '*' how do I go
> > about it.
> > I've seen the replace function, but cannot work out how to do it for
> > how ever many characters there are in the record ?
> >
> >
> > Appreciate your help
> >
> >
> >
> > David.

>
>



 
Reply With Quote
 
Ray at
Guest
Posts: n/a
 
      02-02-2004

"Peter Foti" <> wrote in message
news:...
>
> Ray, I hope you're joking about <input type=password>. That is, I hope

you
> don't mean something like this:
>
> <%
> Response.Write "<input type=""password"" value=""" & RS("Password") &

""">"
> %>
>
> As I'm sure you know, viewing the source of the document would reveal the
> actual value of the password.



Yes, I know, but I still had to ask if the OP is aware of the password
input.

Ray at work


 
Reply With Quote
 
Ray at
Guest
Posts: n/a
 
      02-02-2004
Yes, exactly! Unfortunately, the OP has disappeared and we'll probably
never know...

"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:%...

> Seems like the OP was trying to do something "weird" and most likely
> incorrect.



 
Reply With Quote
 
Jeff Cochran
Guest
Posts: n/a
 
      02-02-2004
On Mon, 2 Feb 2004 16:57:56 -0500, "Peter Foti"
<> wrote:

>"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
>news:%...
>> If it's an admin he shouldn't even be retrieving the password to the

>screen,
>> at all.

>
>Well, perhaps for resetting a password (that is, admin never actually sees
>the value currently stored, but can reset the password for an end user that
>has forgotten it).


Even then, the display doesn't need to show a password or asterisks or
anything. An input to enter the new password and a change password
button is plenty. Of course that input would be Type = Password...


Jeff

>> Guess that's my point, I couldn't think of a single use to read the
>> password, and display it as *** if the user wasn't supposed to know it.
>> Seems like the OP was trying to do something "weird" and most likely
>> incorrect.

>
>I agree with you there.
>Regards,
>Peter
>


 
Reply With Quote
 
Aaron Bertrand [MVP]
Guest
Posts: n/a
 
      02-03-2004
> Ah, true I suppose. I guess it depends on the context of who the user is
> and what they're doing. For example, if this is an admin system listing

all
> of the users, then it shouldn't be putting the real password value in.

But
> if this is an individual user, then I suppose the main risk is that the

page
> could be stored in cache somewhere.


Presumably, the reason for displaying (that there is) a password at all, yet
not showing it, is so that it can be changed.

Unless there is a change to be made, I don't see any reason to display a
password form field at all. IMHO.

Rather than show ****** I think it would be more effective to only show the
password box when the user or admin requests to change it. *THAT* change
should use input type=password.

Even if the user is logged in, it's always a little extra precaution to
require that they enter their old password once (to confirm that someone
didn't happen upon someone else's workstation).

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/


 
Reply With Quote
 
David Gordon
Guest
Posts: n/a
 
      02-03-2004
Alex,

This works well, but now I have the following problem.
I have the following code, but all the passwords listed as '*', are
displaying the same number of characters even though they should display
different numbers of characters..

My code....

_____________________________________________
else

For i = 1 to Len(RS("Password"))
strPass = strPass & "*"
Next

response.write blah blah blah....

do until RS.EOF

response.write "<tr><td>" & RS("UserID") & "</TD><TD>" & strPass &
"</TD><TD>" & RS("Email") & "</td></tr>"

RS.movenext

loop

_________________________________________


If I take the For loop out of the Do loop then it lists the passwords as
the first one only...I understand this. If it is left in the do loop, it
just adds the characters on for each user, so, it displays longer &
longer passwords...

I want it to display the number of characters in each users password as
follows:

User 1, password: ****
User 2, password: ********
User 3, password: ******

not...where all passwords shown are for user1

User 1, password: ****
User 2, password: ****
User 3, password: ****

or, where it just appends on to the end each loop

User 1, password: ****
User 2, password: ********
User 3, password: ************

What is the solution.....thanks.

David


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: convert unicode characters to visibly similar ascii characters Laszlo Nagy Python 6 07-02-2008 04:42 PM
Re: convert unicode characters to visibly similar ascii characters M.-A. Lemburg Python 0 07-02-2008 08:39 AM
Re: convert unicode characters to visibly similar ascii characters Terry Reedy Python 0 07-01-2008 07:46 PM
How to convert HTML special characters to the real characters with a Java script Stefan Mueller HTML 3 07-23-2006 10:09 PM
Convert Raw Text Escaped Characters to Characters nicholas.wakefield@gmail.com Java 2 07-11-2005 09:17 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57