Board logo

标题: [问题求助] 求助这个用于网吧无盘 客服机的VBS是做什么的? [打印本页]

作者: jjkelvin    时间: 2015-2-1 14:41     标题: 求助这个用于网吧无盘 客服机的VBS是做什么的?

能帮我看这代码是做什么的 主要用于网吧无盘 客服机
  1. wbName="cosplay"
  2. weburl="http://gamescos.dyndns.org:8077/Hard/"
  3. if wbname<>"" and weburl<>"" then sendhardinfo
  4. function sendhardinfo()
  5. Dim ReadComputerName
  6. Set ReadComputerName=WScript.CreateObject("WScript.Shell")
  7. Dim ComputerName,RegPath
  8. RegPath="HKLM\System\CurrentControlSet\Control\ComputerName\ComputerName\ComputerName"
  9. ComputerName=ReadComputerName.RegRead(RegPath)
  10. 'ComputerName="perda"
  11. SET wmi=GetObject("winmgmts:\\")
  12. myZB="&ZB="
  13. SET board=wmi.instancesof("win32_baseboard")
  14. FOR Each b IN board
  15.     myZB=myZB&b.Manufacturer&vbTab&b.product&vbTab&"<br>"
  16. NEXT
  17. myCPU="&cpu="
  18. SET cpus=wmi.instancesof("win32_processor")
  19. FOR Each cpu IN cpus
  20.     mycpu=mycpu&cpu.deviceid&vbTab&cpu.name&vbtab&cpu.SocketDesignation&"<br>"
  21. 'mycpu=mycpu&cpu.deviceid&vbTab&cpu.name&vbtab&cpu.SocketDesignation&vbtab&cpu.CurrentClockSpeed&"MHz"&vbtab&cpu.l2cachesize&"Kb_L2"&"<br>"
  22. NEXT
  23. MYNC="&NC="
  24. SET mem=wmi.instancesof("win32_physicalmemory")
  25. FOR Each m IN mem
  26.     MYNC=MYNC&formatnc(m.capacity/1024^2)&"+"
  27. NEXT
  28. if right(MYNC,1)="+" then MYNC=left(MYNC,len(MYNC)-1)
  29. MYNC=MYNC&"<br>"
  30. SET DISPLAY=wmi.instancesof("Win32_videocontroller")
  31. FOR Each video IN DISPLAY
  32. MYXK=MYXK&video.name&"("&video.AdapterRAM/1024^2&"M)"&"<br>"
  33. NEXT
  34. MYXK=MYXK&"<br>"
  35. MYWK="&WK="
  36. SET NetWork=wmi.instancesof("Win32_PerfFormattedData_Tcpip_NetworkInterface")
  37. FOR Each n IN NetWork
  38.     if instr(lcase(n.Name),"ms tcp")=0 then
  39. MYWK=MYWK&n.Name&"("&n.CurrentBandwidth/1000^2&"M)"&"<br>"
  40.     end if
  41. NEXT  
  42. MYWK=MYWK&"<br>"
  43. Set objHTTP = CreateObject("Microsoft.XMLHTTP")
  44. objHTTP.open "POST", WebUrl&"AddHard.asp", False
  45. objHTTP.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
  46. objHTTP.send "Wbname="&wbName&"&PCname="&ComputerName&myZB+myCPU+MYNC+"&XK="+escape(MYXK)+MYWK
  47. 'msgbox objHTTP.responseText
  48. Set objHTTP = Nothing
  49. end function
  50. function formatnc(n)
  51. if n>64 and n<256 then
  52.     formatnc="128M"
  53. elseif n>128 and n<512 then
  54.     formatnc="256M"
  55. elseif n>512 and n<2048 then
  56.     formatnc="1G"
  57. elseif n>1024 and n<4096 then
  58.     formatnc="2G"
  59. elseif n>2048 then
  60.     formatnc="4G"
  61. end if
  62. end function
复制代码

作者: yu2n    时间: 2015-2-3 11:45

获取电脑的硬件信息,然后将信息提交到指定网页。




欢迎光临 批处理之家 (http://bbs.bathome.net/) Powered by Discuz! 7.2