|
English | |||
: Panvasoft / / Windows Vista. |
Microsoft Windows Vista. Vista ( ). , .
: 1 Microsoft Windows Vista . , , , : , . , . … , : « », « », « », « ». , , , , . « » « »? -… . « » « ». … … , . , , , , , - . , . , Windows Management Instrumentation (WMI) COM , , : - . WMI « »: , -, , , . . « » – , « » « ». , , , Windows Vista . () Microsoft Gadgets . Windows Vista , – Windows Sidebar – . Windows Sidebar , – , Quick Launch . , , -, . , Widows Vista , RSS. : ( ) Microsoft Gadgets . , . – . , : , . , Microsoft (-, , Microsoft ), , , , IV, . . ( IV, , .) : • -«» Gadget.xml. , , () HTML . • HTML (, Test.htm). , , HTML: HTML , , . . , : , « ». – , . . , , , , . . ? «, … »? : - - , - , --- 39,95$ . (, , , - .) , «» , : • . : , . , , – . 39,95$, , . Gadgets , : . : “Gadgets”. Gadgets Run () : “%userprofile%appdatalocalmicrosoftwindows sidebargadgets”
. ? Run ? , : . : Run Start () Properties () . Taskbar and Start Menu Properties ( «») , Start Menu ( «») Customize (). ? . Customize Start Menu ( «»), Run command ( «»). OK , Run . , , --- 39,95$ . . Gadgets . , , .gadget (, Test.gadget). , - , . , , . , ( ). ( Gadget.xml Test.htm) . ? – . + Windows Sidebar , . , . . ? Windows Sidebar ? . W indows Sidebar : Start () All Programs ( ) . Accessories () Sidebar. , Windows Sidebar ( Add (). . Sidebar , , , , . , , : , : HTML . : , IV ( , ). ? , (, , ) , « » . , - . INI , ( XML), . , XML . , . XML , , : : <?xml version="1.0" encoding="utf-8" ?>
<gadget> <name>My First Gadget</name> <author>The Microsoft Scripting Guys</author> <copyright>2006 Microsoft Corporation</copyright> <description>Sample gadget that returns the name of the installed operating system.</description> <icons> <icon>icon.png</icon> </icons> <version value="1.0.0.0" MinPlatformVersion="0.1"></version> <sidebar> <type>html</type> <permissions>full</permissions> <code>test.htm</code> <website>www.microsoft.com/technet/scriptcenter</website> </sidebar> </gadget> : , , ( ) . ( – Gadget.xml.) , , , () , : - , : : ( ), ( ). , , «» , . Windows ( .ICO), . - .GIF, .JPG, .PNG. Windows Vista .PNG , .PNG , . ( .) .PNG. , Paint, .JPG . . : ? 64 64 . , , 6464 , , . , , : . . , , ICON ICONS: <icons> <icon>icon.png</icon> </icons>
, ? , , , , . . HTML HTML, , - HTML. HTML HTML ( CSS ) . HTML . , , , WMI . WMI , WMI . , , WMI . , WMI . , , . , WMI : strComputer = "."
Set objWMIService = GetObject("winmgmts:\" & strComputer & "rootcimv2") Set colItems = objWMIService.ExecQuery("Select * From Win32_OperatingSystem") For Each objItem in colItems Msgbox objItem.Caption Next , : WMI , . (, : , .) , -, , - GetObject. : ActiveX component can't create object: 'GetObject' ( ActiveX : 'GetObject')
--… , . WMI , GetObject winmgmts. , CreateObject WbemScripting.WbemLocator , ConnectServer WMI . , : strComputer = "."
Set objLocator = CreateObject("WbemScripting.SWbemLocator") Set objWMIService = objLocator.ConnectServer(strComputer, "rootcimv2") Set colItems = objWMIService.ExecQuery("Select * From Win32_OperatingSystem") For Each objItem in colItems Msgbox objItem.Caption Next ? , . (, , .) WMI moniker ConnectServer WMI . : Set objWMIService = GetObject("winmgmts:" & strComputer & "rootcimv2")
(, !): WbemScripting.SWbemLocator, , ConnectServer, WMI. , ConnectServer : , ( strComputer) WMI ( rootcimv2): Set objLocator = CreateObject("WbemScripting.SWbemLocator")
Set objWMIService = objLocator.ConnectServer(strComputer, "rootcimv2") ? . - . HTML , HTML . , ( ) HTML, . , VBScript. , , - Microsoft Gadgets JScript JavaScript, VBScript ( ). , . , , , Caption . HTML : <html>
<head> <title>My First Gadget</title> <style> body{width:120;height:160} </style> </head> <script language="VBScript"> Sub RunSub strComputer = "." Set objLocator = CreateObject("WbemScripting.SwbemLocator") Set objWMIService = objLocator.ConnectServer(strComputer, "rootcimv2") Set colItems = objWMIService.ExecQuery("Select * From Win32_OperatingSystem") For Each objItem in colItems Msgbox objItem.Caption Next End Sub </script> <body> <input type="button" value="Run" name="run_button" onClick="RunSub"> </body> </html> , : HTML , . , RunSub , WMI . . . , HTML -, HTML ? HTA Tutorial, . <SCRIPT> <INPUT>
., STYLE. STYLE , , , , : <style> body{width:120;height:160} </style>
, 120 ( Windows Sidebar 130 ) 160 . 160 , , height : <style> body{width:120;height:40} </style>
Windows Sidebar , : : , . , , - . SPAN , , , . , , Internet Explorer -. , , , , . , , Windows Sidebar. , , ? , , ? , IV . , . : • . , . • , - . • . ( ) . , . , . SPAN, . HTML . RunSub, , , : <html>
<head> <title>My First Gadget</title> <style>body{width:120;height:160} </style> </head> <script language="VBScript"> Sub RunSub strComputer = "." Set objLocator = CreateObject("WbemScripting.SwbemLocator") Set objWMIService = objLocator.ConnectServer(strComputer, "rootcimv2") Set colItems = objWMIService.ExecQuery("Select * From Win32_OperatingSystem") For Each objItem in colItems DataArea.InnerHTML = objItem.Caption Next End Sub </script> <body> <input type="button" value="Run" name="run_button" onClick="RunSub"><br> <span id="DataArea"></span> </body> </html> , : . : - . , , . , , , , . , , , background BODY HTML . background . jpg : <body background = "background.jpg">
, background.jpg . , bgcolor BODY. ? , ? <body bgcolor = "red">
, . BODY : • Arial , , 8 . • . : <html>
<head> <title>My Gadget</title> <style> body{width:120;height:160;font:8 pt Arial;color:white; filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=1, StartColorStr="#000000", EndColorStr="#0000FF")} </style> </head> <script language="VBScript"> Sub RunSub strComputer = "." Set objLocator = CreateObject("WbemScripting.SwbemLocator") Set objWMIService = objLocator.ConnectServer(".", "rootcimv2") Set colItems = objWMIService.ExecQuery("Select * From Win32_OperatingSystem") For Each objItem in colItems DataArea.InnerHTML = objItem.Caption Next End Sub </script> <body> <input type="button" value="Run" name="run_button" onClick="RunSub"><P> <span id="DataArea"></span> </body> </html> : , Sidebar . . HTA Developer's Center “Auto-Run” ( ) , . , . , . , . , : <html>
<head> <title>My Gadget</title> <style> body{width:120;height:160;font:8 pt Arial;color:white; filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=1, StartColorStr="#000000", EndColorStr="#0000FF")} </style> </head> <script language="VBScript"> Sub RunSub strComputer = "." Set objLocator = CreateObject("WbemScripting.SwbemLocator") Set objWMIService = objLocator.ConnectServer(".", "rootcimv2") Set colItems = objWMIService.ExecQuery("Select * From Win32_OperatingSystem") For Each objItem in colItems DataArea.InnerHTML = objItem.Caption Next End Sub </script> <body> <input type="button" value="Run" name="run_button" onClick="RunSub"> <span id="DataArea"></span> </body> </html> , . : • . - ( , ). • Window_OnLoad. , Window_Onload, -, - . : . (auto-run) : Window_OnLoad . Window_OnLoad : Sub Window_OnLoad
RunSub End Sub , – RunSub. , WMI , Window_OnLoad . ? : . , «» . “Auto-Refresh” , , , , - , – . : , . , . , . , . . , , , . , : . , - : <html>
<head> <title>My Gadget</title> <style> body{width:120;height:40"} </style> </head> <script language="VBScript"> Sub Window_Onload GetMemory iTimerID = window.SetInterval("GetMemory", 10000) End Sub Sub GetMemory Set objLocator = CreateObject("WbemScripting.SwbemLocator") Set objWMIService = objLocator.ConnectServer(".", "rootcimv2") Set colItems = objWMIService.ExecQuery("Select * From Win32_OperatingSystem") For Each objItem in colItems DataArea.InnerHTML = objItem.FreePhysicalMemory Next End Sub </script> <body> <span id="DataArea"></span> </body> </html> , , , , . , , ? , ; , , . , , . ( GetMemory) : Sub GetMemory
Set objLocator = CreateObject("WbemScripting.SwbemLocator") Set objWMIService = objLocator.ConnectServer(".", "rootcimv2") Set colItems = objWMIService.ExecQuery("Select * From Win32_OperatingSystem") For Each objItem in colItems DataArea.InnerHTML = objItem.FreePhysicalMemory Next End Sub , GetMemory , Window_OnLoad: Sub Window_Onload GetMemory iTimerID = window.SetInterval("GetMemory", 10000) End Sub , . -, GetMemory , , , . : iTimerID = window.SetInterval("GetMemory", 10000)
SetInterval . , GetMemory 10 (10 000 ). , : 10 GetMemory , , 10 WMI , , . 10 , 10000 , , 5000 , 5 (5000 ). , 10000 . : . , ( , ) . , (Gadget object model) , . «» , , ( ) , : ( -) Information (). , , , , . , ( ), : <html> <head> <title>My Gadget</title> <style> body{width:120;height:80} </style> </head> <script language="VBScript"> Sub Window_Onload GetMemory iTimerID = window.SetInterval("GetMemory", 10000) End Sub Sub GetMemory Set objLocator = CreateObject("WbemScripting.SwbemLocator") Set objWMIService = objLocator.ConnectServer(".", "rootcimv2") Set colItems = objWMIService.ExecQuery("Select * From Win32_OperatingSystem") For Each objItem in colItems DataArea.InnerHTML = objItem.FreePhysicalMemory Next End Sub Sub RunSub Set objLocator = CreateObject("WbemScripting.SwbemLocator") Set objWMIService = objLocator.ConnectServer(".", "rootcimv2") Set colItems = objWMIService.ExecQuery("Select * From Win32_ComputerSystem") For Each objItem in colItems strHTML = "Computer Name: " & objItem.Name & "<br>" strHTML = strHTML & "User Name: " & objItem.UserName & "<br><br>" Next Set colItems = objWMIService.ExecQuery("Select * From Win32_OperatingSystem") For Each objItem in colItems strHTML = strHTML & "Operating System: " & objItem.Caption & "<br>" strHTML = strHTML & "Service Pack: " & objItem.ServicePackMajorVersion & "<br><br>" Next Set colItems = objWMIService.ExecQuery("Select * From Win32_Processor") For Each objItem in colItems strHTML = strHTML & "Processor: " & objItem.Caption & "<br><br>" Next Set colItems = objWMIService.ExecQuery ("Select * From Win32_NetworkAdapterConfiguration Where IPEnabled = True") For Each objItem in colItems strHTML = strHTML & objItem.Caption & "<br>" For Each strAddress in objItem.IPAddress strHTML = strHTML & "IP Address: " & strAddress & "<br>" Next Next Set objIE = CreateObject("InternetExplorer.Application") objIE.Navigate("about:blank") objIE.Toolbar = 0 objIE.StatusBar = 0 Set objDoc = objIE.Document.Body objDoc.InnerHTML = strHTML objIE.Visible = True End Sub </script> <body> <span id="DataArea"></span><p> <input type="button" value="Information" name="run_button" onClick="RunSub"> </body> </html>
: Windows Vista
: microsoft.com : Feeder, : 26.2.2007, : 0, : 8901, : : : 10 Vista , Microsoft Windows Vista Windows Vista Windows Vista Vista Microsoft Vista SP1 Microsoft Windows Vista :
|
|