XP的,其它OS没测试过function GetMacForXP: string; //注意加uses ShellApi;var ss: Tstringlist; ii: integer;begin Result:='00-00-00-00-00-00'; //失败就用这个混~~~嘿嘿 if WinExec(pchar('cmd /c ipconfig /all >c:/mac.txt'),0)>31 then begin Sleep(1000); ss:=Tstringlist.Create; try ss.LoadFromFile('c:/mac.txt'); for ii:=0 to ss.Count-1 do begin if pos('Physical Address',ss[ii])>0 then begin Result:=copy(ss[ii],length(ss[ii])-17,18); break; end; end; finally ss.Free; DeleteFile('c:/mac.txt'); end; end;end;