急!!!!如何取道客户机的mac地址阿!!!跪求加分阿!!
大虾们:
请问怎么样取客户的mac呢???在线等!!!!不够了在加分!!!
try {
Process process = Runtime.getRuntime().exec( "ipconfig /all ");
InputStreamReader ir = new InputStreamReader(process.getInputStream());
LineNumberReader input = new LineNumberReader(ir);
String line;
while ((line = input.readLine()) != null)
if (line.indexOf( "Physical Address ") > 0)
{
String MACAddr = line.substring(line.indexOf( "- ") - 2);
System.out.println( "MAC address = [ " + MACAddr + "] ");
}
}
catch (
java.io.IOException e)
{
System.out.println( "
IOException " + e.getMessage());
}
以上代码取到的是服务器的mac而并非客户的mac,怎么样取得客户的mac呢???
急!!!!在线等!!!!一定加分!!!
------解决方案--------------------使用javascript
------解决方案--------------------很简单。用脚本。加我QQ8167898
------解决方案-------------------- <HTML> <HEAD> <TITLE> WMI Scripting HTML </TITLE>
<META http-equiv=Content-Type content= "text/html; charset=gb2312 ">
<SCRIPT language=JScript event= "OnCompleted(hResult,pErrorObject, pAsyncContext) " for=foo>
document.forms[0].txtMACAddr.value=unescape(MACAddr);
document.forms[0].txtIPAddr.value=unescape(IPAddr);
document.forms[0].txtDNSName.value=unescape(sDNSName);
//document.formbar.submit();
</SCRIPT>
<SCRIPT language=JScript event=OnObjectReady(objObject,objAsyncContext) for=foo>
if(objObject.IPEnabled != null && objObject.IPEnabled != "undefined " && objObject.IPEnabled == true)
{
if(objObject.MACAddress != null && objObject.MACAddress != "undefined ")
MACAddr = objObject.MACAddress;
if(objObject.IPEnabled && objObject.IPAddress(0) != null && objObject.IPAddress(0) != "undefined ")
IPAddr = objObject.IPAddress(0);
if(objObject.DNSHostName != null && objObject.DNSHostName != "undefined ")
sDNSName = objObject.DNSHostName;
}
</SCRIPT>
<META content= "MSHTML 6.00.2800.1106 " name=GENERATOR> </HEAD>
<BODY>
<OBJECT id=locator classid=CLSID:76A64158-CB41-11D1-8B02-00600806D9B6 VIEWASTEXT> </OBJECT>
<OBJECT id=foo classid=CLSID:75718C9A-F029-11d1-A1AC-00C04FB6C22