如何编写一个不回显到屏幕的密码例程? [英] how to write a password routine that doesn't echo to the screen?
问题描述
输入密码时,我们并没有真正看到这些字符 - 我们看到了
****。我怎样才能在C中编写这样的例程?我怎样才能回复输入?如何从键盘上获取字符/字符串
而不键入它们并在结尾处输入?就像在BASIC中读取(kbd,...)一样?
我在XP平台上运行mingw,
谢谢,
Pflanzen。
Hi,
When entering a password we don''t really see the characters - we see
**** instead. How can I write such a routine in C? How can I ''echo
off'' the inputs? How can I get a characters/strings from the keyboard
without typing them and ENTER at the end? Like read(kbd,...) in BASIC?
I am running mingw on an XP platform,
Thanks,
Pflanzen.
推荐答案
Pflanzen Gold< pf ********** @ yahoo。 COM>潦草地写道:
Pflanzen Gold <pf**********@yahoo.com> scribbled the following:
输入密码时我们并没有真正看到角色 - 我们看到的是
****。我怎样才能在C中编写这样的例程?我怎样才能回复输入?如何从键盘上获取字符/字符串
而不键入它们并在最后输入?就像在BASIC中读取(kbd,...)一样?
Hi, When entering a password we don''t really see the characters - we see
**** instead. How can I write such a routine in C? How can I ''echo
off'' the inputs? How can I get a characters/strings from the keyboard
without typing them and ENTER at the end? Like read(kbd,...) in BASIC?
在ISO标准C代码的限制范围内,你不能这样做。你必须
使用特定于操作系统的API。
-
/ - Joona Palaste(pa **** *@cc.helsinki.fi)-------------芬兰-------- \
\-- http://www.helsinki.fi/~palaste ----------- ----------规则! -------- /
" C ++。 C ++运行。运行,++,运行。"
- JIPsoft
You can''t do it, within the limits of ISO standard C code. You have to
use OS-specific APIs.
--
/-- Joona Palaste (pa*****@cc.helsinki.fi) ------------- Finland --------\
\-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
"C++. C++ run. Run, ++, run."
- JIPsoft
pf ********** @ yahoo.com (Pflanzen Gold)写道:
pf**********@yahoo.com (Pflanzen Gold) writes:
输入密码时我们不会真的看到了人物 - 我们看到了
****。我怎样才能在C中编写这样的例程?我怎样才能回复输入?如何从键盘上获取字符/字符串
而不键入它们并在最后输入?就像在BASIC中读取(kbd,...)一样?
我在XP平台上运行mingw,
When entering a password we don''t really see the characters - we see
**** instead. How can I write such a routine in C? How can I ''echo
off'' the inputs? How can I get a characters/strings from the keyboard
without typing them and ENTER at the end? Like read(kbd,...) in BASIC?
I am running mingw on an XP platform,
它不能对于非便携式解决方案,请尝试使用系统特定的新闻组。
-
Keith汤普森(The_Other_Keith) ks***@mib.org < http://www.ghoti.net/~kst>
圣地亚哥超级计算机中心< *> < http://users.sdsc.edu/~kst>
我们必须做点什么。这是事情。因此,我们必须这样做。
It can''t be done portably in C. For non-portable solutions, try a
system-specific newsgroup.
--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Pflanzen Gold写道:
Pflanzen Gold wrote:
输入密码时我们并没有真正看到人物 - 我们看到了
****。我怎样才能在C中编写这样的例程?我怎样才能回复输入?如何从键盘上获取字符/字符串
而不键入它们并在最后输入?就像在BASIC中读取(kbd,...)一样?
我在XP平台上运行mingw,
When entering a password we don''t really see the characters - we see
**** instead. How can I write such a routine in C? How can I ''echo
off'' the inputs? How can I get a characters/strings from the keyboard
without typing them and ENTER at the end? Like read(kbd,...) in BASIC?
I am running mingw on an XP platform,
你不能在标准便携式C中进行,如此处所述。任何
特定的系统可能都有手段,所以你需要找一个讨论你的系统的
新闻组。由此产生的代码不会是便携式的,因此在这里是偏离主题的。
-
Chuck F(cb ********@yahoo.com)(cb********@worldnet.att.net)
可用于咨询/临时嵌入式和系统。
< http://cbfalconer.home.att.net>使用worldnet地址!
You can''t do it in standard portable C, as discussed here. Any
specific system will probably have means, so you need to find a
newsgroup that discusses your system. The resultant code will not
be portable, and thus is off-topic here.
--
Chuck F (cb********@yahoo.com) (cb********@worldnet.att.net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net> USE worldnet address!
这篇关于如何编写一个不回显到屏幕的密码例程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!