要求是,我需要windows userName和password作为应用程序登录userName和密码。 那么,请告诉我如何检索Windows用户名和密码以及如何在Intranet应用程序中使用它登录用户名和密码。
答案 0 :(得分:1)
您可以使用System.getProperties()
功能访问系统信息,如下所示。
Properties p = System.getProperties();
p.list(System.out);
如果您想要username
这样的特定属性,那么您可以执行以下操作:
System.out.println(System.getProperty("user.name"));
但据我所知,系统password
不可用作系统属性,因为它将是一个巨大的安全漏洞。
答案 1 :(得分:0)
不,你不能读密码。
您将通过function checkValue() {
var checkedValue = null;
var inputElements = document.getElementsByName('check_list[]');
for (var i = 0; inputElements[i]; ++i) {
if (inputElements[i].checked) {
checkedValue = inputElements[i].value;
break;
}
return checkedValue;
}
}
var iframe = document.createElement('iframe');
switch(checkValue()) {
case 'TotalVoiceTrafficBH2':
iframe.src = 'http://localhost/xampp/www/interactive_php_mysql_charts/chart_trans2.html';
break;
case 'TotalVoiceTrafficBH1':
default:
iframe.src = 'http://localhost/xampp/www/interactive_php_mysql_charts/chart_trans1.html';
break;
}
document.body.appendChild(iframe);