# MAC物理地址显示 - Rainmeter技术教程 - 雨滴社区 - Powered by Discuz!
 找回密码
 点击注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 1022|回复: 0

[技术交流] MAC物理地址显示

[复制链接]

签到天数: 2 天

[LV.1]初来乍到

 楼主| 发表于 2019-9-27 14:37:33 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?点击注册

x
本帖最后由 jumio 于 2019-9-27 16:49 编辑

在论坛逛了一圈没有发现提到物理地址显示的帖子,我就来发一篇大家讨论下。

我用autoit 做的脚本来调用mac地址信息,雨滴插件再调用脚本数据显示出来。
这个插件显示MAC地址由于转换问题大概要10秒后才会显示出来。


雨滴皮肤
  1. [Rainmeter]
  2. Update=1000
  3. DynamicWindowSize=1

  4. [Metadata]
  5. Name=NETADDRESS
  6. Author=Jumio
  7. Information=Network Information
  8. Version=Sep 9, 2019

  9. [Variables]

  10. ;Set this if needed
  11. Interface=Best

  12. MACAddress="Asking Hardware"

  13. Font=Trebuchet MS
  14. LabelColor=200,200,200
  15. ValueColor=200,200,200

  16. ;[Network WEB IP]=================================

  17. [MeasureIPLan]
  18. Measure=Plugin
  19. Plugin=Plugins\SysInfo.dll
  20. SysInfoType=IP_ADDRESS
  21. SysInfoData=0

  22. [MeterIPLabel]
  23. Meter=String
  24. X=0r
  25. Y=0r
  26. FontFace=#Font#
  27. FontColor=#LabelColor#
  28. FontSize=9
  29. StringStyle=Normal
  30. StringAlign=Left
  31. AntiAlias=1
  32. Text="IP地址:"

  33. [MeterLANIPText]
  34. Meter=String
  35. MeasureName=MeasureIPLan
  36. X=160r
  37. Y=2r
  38. FontFace=#Font#
  39. FontColor=#ValueColor#
  40. FontSize=9
  41. StringStyle=Normal
  42. StringAlign=Right
  43. AntiAlias=1

  44. [MeasureAdapterDesc]
  45. Measure=Plugin
  46. Plugin=Plugins\SysInfo.dll
  47. SysinfoType=ADAPTER_DESCRIPTION
  48. SysInfoData=0

  49. [MeasureFireAction]
  50. Measure=Calc
  51. Formula=Counter % 30
  52. IfEqualValue=0
  53. IfEqualAction=!Execute ["#CURRENTPATH#MAC.exe" "#CURRENTCONFIG#" "#PROGRAMPATH#" "[MeasureAdapterDesc]"]

  54. [MeterShowMAC]
  55. Meter=String
  56. X=0
  57. Y=20r
  58. FontFace=#Font#
  59. FontSize=9
  60. FontColor=#ValueColor#
  61. StringStyle=Normal
  62. AntiAlias=1
  63. DynamicVariables=1
  64. Text=MAC地址: #MACAddress#
复制代码
autoit 脚本内容

  1. ; *** Start added by AutoIt3Wrapper ***
  2. #include <AutoItConstants.au3>
  3. ; *** End added by AutoIt3Wrapper ***
  4. #NoTrayIcon
  5. #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
  6. #AutoIt3Wrapper_UseUpx=y
  7. #AutoIt3Wrapper_Compile_Both=y
  8. #AutoIt3Wrapper_Change2CUI=n
  9. #AutoIt3Wrapper_Add_Constants=n
  10. #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

  11. #include <Constants.au3>
  12. #include <Array.au3>

  13. Local $Out

  14. if $CmdLine[0] = 3 Then

  15.         $ConfigPath = $CmdLine[1]
  16.         $ProgramPath = $CmdLine[2] & "Rainmeter.exe"
  17.         $NICName = $CmdLine[3]

  18.         $Cmd = Run(@ComSpec & " /c " & 'ipconfig /all', "", @SW_HIDE, $STDOUT_CHILD)

  19.         While 1
  20.                 $Out = $Out & StdoutRead($Cmd)
  21.                 If @error Then ExitLoop
  22.         Wend

  23.         $NICName=StringReplace($NICName, "", "\\(")
  24.         $NICName=StringReplace($NICName, "(", "\(")
  25.         $NICName=StringReplace($NICName, ")", "\)")
  26.         $NICName=StringReplace($NICName, "[", "\[")
  27.         $NICName=StringReplace($NICName, "]", "\]")

  28.         $RegExp = "(?siU)" & $NICName & ".*物理地址. . . . . . . . . . . . . : (.*)\n"

  29.         $MACAddress = StringRegExp($Out, $RegExp, 3)

  30.         if IsArray($MACAddress) Then
  31.                 ShellExecute($ProgramPath, "!RainmeterSetVariable MACAddress " & $MACAddress[0] & " " & $ConfigPath)
  32.         Else
  33.                 ShellExecute($ProgramPath, "!RainmeterSetVariable MACAddress Unknown" & " " & $ConfigPath)
  34.         EndIf

  35. EndIf

  36. Exit
复制代码



ipmac_20190927.rmskin

382.69 KB, 下载次数: 0, 下载积分: 活跃值 -1 点

售价: 1 点活跃值  [记录]  [购买]

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 点击注册

本版积分规则

快速回复 返回顶部 返回列表