求教:在Java中有没有什么办法得到本机网卡的Mac地址? 用 java 得到这个地址也没有什么用啊。用 jni 太麻烦,干脆直接调用外部命令好了。如果是在 windows 下,可以用ipconfig /all来得到这个地址。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 有用,兄弟。我们公司开发的产品用类的方式发布。想读取网卡Mac地址来限定只能在特定机器上使用。 以下是JAVA的程序:import Snmp.*;OIDStr[0]= new String(".1.3.4.1.2.1.3.1.1.2.0.0.1.4.7."+args[1])api=new SnmpAPI();api.start();SnmpPDU pdu=new SnmpPDU(api);pdu.command=apiGET_REQ_MSG;SnmpSession Session=new SnmpSession(api);Session.version=SnmpAPI.SNMP VERSION_1;Session.peername=Host[i];SnmpOID oid=new SnmpOID(OIDStr[i],api);if(oid.toValue()!=null)pdu.addNull(oid); try{ Session.open(); pdu=session.syncSend(pdu);}catch(SnmpException e){if(pdu==null){System.out.println("Request timed out to :"+Host);System.exit(1);}} SnmpVarBind varBind=(SnmpVarBind)Pdu.varibles.firstElement();pdustr=varbind.toString();但代码不是完整的。是否可以帮助改为VB的? WEB服务器里的数据库连接池不够用了怎么办? 这样的程序是用什么写的? help!非常疑惑i/o流的构造 编程注定是男生的工作吗?我要改变这个论断! 多线程中的一点疑问 急!!!!!!!!!!!!!1 请教各位大侠(散分) 110 关于SCJP1.4考试,有兴趣的进来讨论一下。 那位高手知道在JAVA中如何讀取ODBC數據源中的列表?Thanks! 用VAJ的兄弟,我新撞VAJ,帮助文件找不到?? 连接占线导致另一个 hstmt,一般是什么原因引起的???20分!
我们公司开发的产品用类的方式发布。
想读取网卡Mac地址来限定只能在特定机器上使用。
OIDStr[0]= new String(".1.3.4.1.2.1.3.1.1.2.0.0.1.4.7."+args[1])
api=new SnmpAPI();
api.start();
SnmpPDU pdu=new SnmpPDU(api);
pdu.command=apiGET_REQ_MSG;
SnmpSession Session=new SnmpSession(api);
Session.version=SnmpAPI.SNMP VERSION_1;
Session.peername=Host[i];
SnmpOID oid=new SnmpOID(OIDStr[i],api);
if(oid.toValue()!=null)pdu.addNull(oid);
try{
Session.open();
pdu=session.syncSend(pdu);
}catch(SnmpException e){
if(pdu==null){
System.out.println("Request timed out to :"+Host);
System.exit(1);
}
}
SnmpVarBind varBind=(SnmpVarBind)Pdu.varibles.firstElement();
pdustr=varbind.toString();但代码不是完整的。
是否可以帮助改为VB的?