密码字符显示的不仅仅是我在密码文本框中输入的内容 [英] Password characters shows more than what i type in password text box

查看:57
本文介绍了密码字符显示的不仅仅是我在密码文本框中输入的内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

登录Lotus Notes时我真的很想知道。



我在登录时键入8个字符的密码,它似乎超过12个字符。



我想,键入一些额外的字符。然后我才意识到格式是这样设置的。如果我输入1个字符就会显示为4个字符的叹息!!!,我喜欢在asp.net中实现相同的功能。你能帮帮我吗。



我不知道在哪里问这个问题。这就是为什么我发布的一般。



例如:



如果我在密码文本框中输入a,它显示为XXXX,然后如果我输入b,则显示XXXXXXXX,这就是它的运行方式。它为我输入的每个字符添加3个字符。我只想知道它是如何实现的?



我相信这能让我清楚地知道我要问的事情.......

I really wonder while logging into Lotus notes.

Where i typed 8 characters of password while logging,it appears to be more than 12 characters.

I thought, typed some extra characters. Then only i realize that the format is set like that.If I type 1 character it shows as 4 character sighs!!!,I like to implement the same in asp.net. Could you please help me with this.

I do not know where to ask this question. thats why i posted in general.

for example:

if i type ''a'' in password text box, it appears "XXXX", then if i type ''b'' it appears "XXXXXXXX" this is how it goes on. It appends 3 more character for every characters i type. I only want to know, how it can be achieved?

I believe this gives clear idea about the thing i''m asking about.......

推荐答案

您可以执行类似这样的文本更改事件,但之后您必须删除额外的Char。在验证密码之前。



You could do a text change event something like this, but then you have to remove the extra Char. before validating the password.

Private Sub PasswordTextBox_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PasswordTextBox.TextChanged
    If PasswordTextBox.Text.Count <= 1 Then
        PasswordTextBox.AppendText("***")
    End If
End Sub





输入文本是测试输出是否为T *** est



the Input text is Test the output is T***est


不确定我是否正确理解了这个问题,但许多应用程序都没有显示密码的实际长度。例如,无论密码长度如何,文本框都可能始终显示8个星号。通常这样做是为了让你身后的人无法解释密码的长度以获得它的暗示。



现在如果你喜欢,你可以跟踪实际的键输入并在文本框中设置其他内容。在这种情况下,你根本不会使用文本框中的文本,因为它是无关紧要的。真实密码位于您放置击键的变量中。



这是否实用,我不反对或代表它。通常用户可能会发现这一点令人困惑,但如果有理由实施它,为什么不呢。
Not sure if I understood the question correctly, but many applications don''t show the actual length of the password. For example, regardless of the password length the text box may show always 8 asterisks. Often this is done so that a person behind you cannot interpret the length of the password in order to get a hint of it.

Now if you like, you can track the actual key input and set something else to the text box. In this case you wouldn''t actually use the text in the text box at all since it''s irrelevant. The real password is in the variable where you put the keystrokes.

Whether this is practical or not, I''m not against or on behalf of it. Often users may find this confusing, but if there are reasons to implement it, why not.


嗨人,



我尝试相同并完成相同的工作。

对于每次点击,它应该在文本框中附加3个字符仅用于视觉目的。

随着这个



Hi Folks,

I tried the same and accomplished the same.
For each and every click it should append 3 more chars to the text box only for visual purpose.
With that

private void textBox1_KeyUp(object sender, KeyEventArgs e)
        {
//Records each and every key stroke and stores in temp variable.
             tempPassword += e.KeyCode.ToString();
//It should append three more characters to the text box.
             textBox1.AppendText("***");
        }





这是我一直在寻找的代码。



This is the code I''ve been looked for.


这篇关于密码字符显示的不仅仅是我在密码文本框中输入的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆