import javax.mail.*;
import java.io.*;

public class ConsoleAuthenticator extends Authenticator{
	private String fUser;
	private String fPassword;

	public PasswordAuthentication getPasswordAuthentication(){
		try{
			System.out.print("请输入用户名:");
			DataInputStream datauser=new DataInputStream(System.in);
			fUser=datauser.readLine();
			System.out.print("请输入密码:");
			DataInputStream datapassword=new DataInputStream(System.in);
			fPassword=datapassword.readLine();
		}catch(Exception e){}
		return new PasswordAuthentication(fUser, fPassword);
	}
}
