JavaµÃµ½macµØÖ·
/*
* GetMacAddress .java
*
* description:get Mac addreess
*
* @author hadeslee
*
* Created on 2007-9-27, 9:11:15
*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package test2;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
/**
*
*/
public class GetMacAddress {
public static String getMACAddress() {
String address = "";
String os = System.getProperty("os.name");
System.out.println(os);
if (os != null && os.startsWith("Windows")) {
try {
ProcessBuilder pb = new ProcessBuilder("ipconfig", "/all");
Process p = pb.start();
BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream()));
String line;
while ((line = br.readLine()) != null) {
if (line.indexOf("Physical Address") != -1) {
int index = line.indexOf(":");
address = line.substring(index+1);
break;
}
}
br.close();
return address.trim();
} catch (IOException e) {
}
}
return address;
}
public static void main(String[] args) {
System.out.println("" + Test.getMACAddress());
}
}
Ïà¹ØÎĵµ£º
// ¼òÒ×JAVA»ñÈ¡ÍøÒ³ÓÐЧÓÊÏäµØÖ· ---by 77
import java.awt.*;
import java.awt.event.*;
import java.net.*;
import java.io.*;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class solo7 {
public static void main(String args[]){
  ......
²»¹ÜÄãÐŲ»ÐÅ£¬¼´Ê¹¶àôÊìÁ·±à³ÌµÄÈËÔ±ÔÚcodingµÄʱºò¶¼»á³öÏÖÒâÏë²»µ½µÄbug¡£ÔÚÉÏƪÎÄÕÂÖÐÎÒÔøÌáµ½£¬bugµÄÔì³ÉÊǶà¸ö·½ÃæµÄ×ۺϽá¹û£¬ÓÐЩbugÊÇ¿ÉÒÔÐÞ¸´µÄ£¬µ«ÊÇÓÐЩÂß¼ÉϵÄbugÒªÐÞ¸´¿É²»ÊÇÄÇôÈÝÒ×µÄÊÂÇ飬¾ÍÏñÎÒÃÇ×ö´íÁËÒ»¼þÊÂÇ飬Èç¹û²»È¥´Ó¸ù±¾ÉϸÄÕý¾Í»á·¸¸ü´óµÄ´íÎóÒ»Ñù£¬ÓÐʱºòbugÒ²ÊÇÒ»¸ö»ýÀ ......
¹ØÓÚ Java Concurrency
×Ô´ÓJavaµ®Éú֮ʱ£¬Java ¾ÍÖ§³Ö²¢ÐеĸÅÄ±ÈÈçÏ̺߳ÍËø»úÖÆ¡£Õâ¸ö½Ì³Ì°ïÖú¿ª·¢¶àÏß³ÌJava³ÌÐòÔ±Äܹ»Àí½âºËÐĵÄJava²¢ÐÐÀíÄîÒÔ¼°ÈçºÎʹÓÃËûÃÇ¡£ ÄÚÈÝÉæ¼°µ½JavaÓïÑÔÖеÄỊ̈߳¬ ÖØÁ·¼¶ÒÔ¼°ÇáÁ¿¼¶Í¬²½»úÖÆ ÒÔ¼°JavaSE 5 ÖеÄËø£¬Ô×ÓÁ¿ ²¢ÐÐÈÝÆ÷£¬Ï̵߳÷¶È ÒÔ¼°Ïß³ÌÖ´ÐÐÕß ......
1.ÔÚÄã¾õµÃÓдíµÄµØ·½ÉèÖöϵã
2.µã»÷¼×¿Ç³æÒ»ÑùµÄ°´Å¥ÏÂÃæµÄ×Ó°´Å¥£¬Ò²ÊǼ׿dzæÒ»ÑùµÄ£¬½ÐDebug
3.ÔËÐгÌÐò£¬µ±³ÌÐòÔËÐе½¸Õ²ÅÉèÖöϵãµÄλÖþͻáÍ£ÏÂÀ´£¬²¢ÇÒÄÇÐдúÂëµ×É«»á¸ßÁÁÏÔʾ¡£
4.½Ó×ÅÄãÔÚÈçϽçÃæÄã¿ÉÒÔ¿´µ½ÄãÏëÒªµÄÐÅÏ¢
5.ÔÚVariablesÀïÃæ¿ÉÒԲ鿴ËùÓбäÁ¿µÄÖµ£¬±ÈÈç¸Õ²ÅÉèÖõĶϵãÀïÃæµÄstrClassNameµÄÖµ¾Í ......
ÔÚÏîÄ¿ÖУ¬ÎÒÃǺܶ඼Óõ½ÁËxmlÎļþ£¬ÎÞÂÛÊDzÎÊýÅäÖû¹ÊÇÓëÆäËüϵͳµÄÊý¾Ý½»»¥¡£
½ñÌì¾ÍÀ´½²Ò»ÏÂJava ÖÐʹÓÃdom4jÀ´²Ù×÷XMLÎļþ¡£
ÎÒÃÇÐèÒªÒýÈëµÄ°ü£º
//Îļþ°ü
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileWriter;
//¹¤¾ß°ü
import java.util.Ite ......