显示"*"当输入任何键时 [英] Displaying "*" when any key entered

查看:48
本文介绍了显示"*"当输入任何键时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在按下任何键时如何显示"*"字符,但如何检索实际按下的键?

例子...

How does one display the "*" character when any key is pressed, but retrieve the actual key pressed?

EXAMPLE ...

string UserID = "";
string Password = "";
Console.Write("Enter User ID: ");
UserID = Colsole.ReadLine();
Console.Write("Enter Password: ");
//
// I don't want what is typed to be displayed - but display a "*" for each key pressed
//
Password = Console.ReadLine();

推荐答案

^ ]似乎可以回答您的问题.
This[^] looks like it has an answer to your question.


文章此处 [ ^ ]和此处 [
There is a lot of good information on the subject in the articles here[^], here[^] and here[^].


这篇关于显示"*"当输入任何键时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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