0
보안 투표 시스템 용으로 하나의 응용 프로그램을 개발 중입니다. 특정 머신의 MAC 주소를 '투표기'로 설정해야합니다. 클라이언트 컴퓨터의 MAC 주소는 어떻게 얻을 수 있습니까?jsp에서 클라이언트 컴퓨터의 MAC 주소를 얻을 수있는 방법
보안 투표 시스템 용으로 하나의 응용 프로그램을 개발 중입니다. 특정 머신의 MAC 주소를 '투표기'로 설정해야합니다. 클라이언트 컴퓨터의 MAC 주소는 어떻게 얻을 수 있습니까?jsp에서 클라이언트 컴퓨터의 MAC 주소를 얻을 수있는 방법
//InetAddress address = InetAddress.getLocalHost();
InetAddress address = InetAddress.getByName("192.168.46.53");
/*
* Get NetworkInterface for the current host and then read the
* hardware address.
*/
NetworkInterface ni = NetworkInterface.getByInetAddress(address);
if (ni != null) {
byte[] mac = ni.getHardwareAddress();
if (mac != null) {
/*
* Extract each array of mac address and convert it to hexa with the
* following format 08-00-27-DC-4A-9E.
*/
for (int i = 0; i < mac.length; i++) {
System.out.format("%02X%s", mac[i], (i < mac.length - 1) ? "-" : "");
}
} else {
// Address doesn't exist or is not accessible.
}
} else {
// Network Interface for the specified address is not found.
}
어떻게 클라이언트의 MAC 주소를 JSP로 얻을 수 있습니까? –
코드 뒤에이 스 니펫을 사용하십시오 .... –
어떻게 하시겠습니까? 여기에 새로운 .... –