Redian新闻
>
No decent way for input password from command line.
avatar
No decent way for input password from command line.# Java - 爪哇娇娃
g*g
1
Sun sucks big time. I can't wait until 1.6 is out.
avatar
y*o
2
You can try the rc version, which is out.

【在 g*****g 的大作中提到】
: Sun sucks big time. I can't wait until 1.6 is out.
avatar
B*h
3
what's wrong with Console.readPassword()? cann't be too picky with Java ;-)

【在 g*****g 的大作中提到】
: Sun sucks big time. I can't wait until 1.6 is out.
avatar
g*g
4
coz a password mask is not big enough to justify a signicant runtime change
when we are talking about a product. Let alone a RC.

【在 B*********h 的大作中提到】
: what's wrong with Console.readPassword()? cann't be too picky with Java ;-)
avatar
y*o
5
I just saw it and tried it with the 1.6-rc version, maybe this is what you
want.
http://java.sun.com/docs/books/tutorial/essential/io/cl.html
import java.io.Console;
import java.util.Arrays;
import java.io.IOException;
public class Password {

public static void main (String args[]) throws IOException {
Console c = System.console();
if (c == null) {
System.err.println("No console.");
System.exit(1);
}
String login = c.readLine("Enter

【在 g*****g 的大作中提到】
: Sun sucks big time. I can't wait until 1.6 is out.
avatar
g*g
6
1.6 is not an option for me.
I end up with a solution which uses
another thread to write "\b*" all the time.

【在 y********o 的大作中提到】
: I just saw it and tried it with the 1.6-rc version, maybe this is what you
: want.
: http://java.sun.com/docs/books/tutorial/essential/io/cl.html
: import java.io.Console;
: import java.util.Arrays;
: import java.io.IOException;
: public class Password {
:
: public static void main (String args[]) throws IOException {
: Console c = System.console();

avatar
y*o
7
Look, buddy:
发信人: goodbug (好虫), 信区: Java
标 题: No decent way for input password from command line.
发信站: BBS 未名空间站 (Tue Nov 21 11:25:52 2006), 转信
Sun sucks big time. I can't wait until 1.6 is out.

【在 g*****g 的大作中提到】
: 1.6 is not an option for me.
: I end up with a solution which uses
: another thread to write "\b*" all the time.

avatar
c*t
8
Unfortunately, unless you want to force people to upgrade to 1.6,
even a year after 1.6 coming out, you may still get 90% fraction
of people who are stuck with older JVM. Heck, a lot of people are
still using 1.4, particularly on old Mac models, non-windows machines.

【在 g*****g 的大作中提到】
: Sun sucks big time. I can't wait until 1.6 is out.
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。