Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

162 lines
4.3 KiB

  1. <HTML>
  2. <HEAD>
  3. <META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
  4. <TITLE></TITLE>
  5. <SCRIPT LANGUAGE="VBS">
  6. Dim Locator
  7. Dim Service
  8. Dim Class
  9. </SCRIPT>
  10. <SCRIPT LANGUAGE="VBS">
  11. <!--
  12. Sub window_onload()
  13. 'Create the scriptable locator
  14. Set Locator = CreateObject ("WbemScripting.SWBemLocator")
  15. ClassNav.OnReadySignal ()
  16. TableHeader.style.visibility = "hidden"
  17. End Sub
  18. //-->
  19. </SCRIPT>
  20. <SCRIPT LANGUAGE="VBS">
  21. <!--
  22. Function TypeAsString (Property)
  23. TypeAsString = "uint32"
  24. select case Property.cimType
  25. Case 16
  26. TypeAsString = "sint8"
  27. Case 17
  28. TypeAsString = "uint8"
  29. Case 2
  30. TypeAsString = "sint16"
  31. Case 18
  32. TypeAsString = "uint16"
  33. Case 3
  34. TypeAsString = "uint32"
  35. Case 20
  36. TypeAsString = "sint64"
  37. Case 21
  38. TypeAsString = "uint64"
  39. Case 4
  40. TypeAsString = "real32"
  41. Case 5
  42. TypeAsString = "real64"
  43. Case 11
  44. TypeAsString = "boolean"
  45. Case 8
  46. TypeAsString = "string"
  47. Case 101
  48. TypeAsString = "datetime"
  49. Case 102
  50. TypeAsString = "ref"
  51. Set Qualifier = Property.Qualifiers_("cimtype")
  52. StrongRefArray = Split(Qualifier.Value,":")
  53. if (UBound(StrongRefArray) > 0) then
  54. TypeAsString = TypeAsString & " " & StrongRefArray(1)
  55. end if
  56. Case 103
  57. TypeAsString = "char16"
  58. Case 13
  59. TypeAsString = "object"
  60. Set Qualifier = Property.Qualifiers_("cimtype")
  61. StrongObjArray = Split(Qualifier.Value,":")
  62. if (UBound(StrongObjArray) > 0) then
  63. TypeAsString = TypeAsString & " " & StrongObjArray(1)
  64. end if
  65. end select
  66. if Property.isArray = true then
  67. TypeAsString = TypeAsString & " []"
  68. end if
  69. End Function
  70. Sub ClassNav_EditExistingClass(selObj)
  71. on error resume next
  72. Dim classStr
  73. Dim Property
  74. Dim CIMClass
  75. ErrorMessage.innerText = ""
  76. 'Clear the table (apart from the first row)
  77. TableHeader.style.visibility = "hidden"
  78. while (ClassTable.rows.length > 1)
  79. ClassTable.deleteRow()
  80. wend
  81. Set CIMClass = Service.Get (selObj)
  82. for each Property in CIMClass.Properties_
  83. Set row = ClassTable.insertRow
  84. row.insertCell().innerText = Property.Name
  85. row.insertCell().innerText = TypeAsString (Property)
  86. row.insertCell().innerText = Property.Origin
  87. next
  88. ClassTable.refresh
  89. TableHeader.style.visibility = "visible"
  90. if err <> 0 then
  91. ErrorMessage.innerText = "Error: " & Err.description & " - " & Err.source
  92. end if
  93. End Sub
  94. Sub ClassNav_NotifyOpenNameSpace(theNameSpace)
  95. Set Service = Locator.ConnectServer (,theNamespace)
  96. End Sub
  97. Sub ClassNav_GetIWbemServices(lpctstrNamespace, bUpdatePointer, lpsc, lppServices, lpbUserCancel)
  98. Login.GetIWbemServices lpctstrNamespace, bUpdatePointer, lpsc, lppServices, lpbUserCancel
  99. Set Service = Locator.ConnectServer (,lpctstrNamespace)
  100. End Sub
  101. -->
  102. </SCRIPT>
  103. </HEAD>
  104. <BODY LANGUAGE=javascript onload="return window_onload()" bgColor=silver>
  105. <P align=center><STRONG><FONT face=Verdana size=5>WBEM ActiveX Control &amp; Scripting
  106. Demo</FONT></STRONG>
  107. </P>
  108. <P><FONT color=darkgreen face=Verdana size=5>Select a Class:</FONT>
  109. </P>
  110. <P>
  111. <OBJECT classid=clsid:C587B673-0103-11D0-8CA2-00AA006D010A
  112. codeBase=http://alanbos3/wbem/WBEMTool.cab#Version=1,01,525,0000 height=304 id=ClassNav
  113. style="HEIGHT: 304px; LEFT: 0px; TOP: 0px; WIDTH: 808px" width=97.35%
  114. VIEWASTEXT>
  115. <PARAM NAME="_Version" VALUE="65536">
  116. <PARAM NAME="_ExtentX" VALUE="21379">
  117. <PARAM NAME="_ExtentY" VALUE="8043">
  118. <PARAM NAME="_StockProps" VALUE="0">
  119. <PARAM NAME="NameSpace" VALUE="">
  120. </OBJECT>
  121. </P>
  122. <OBJECT classid=clsid:9C3497D6-ED98-11D0-9647-00C04FD9B15B
  123. codeBase=http://alanbos3/wbem/WBEMTool.cab#Version=1,01,525,0000 id=Login><PARAM NAME="_Version" VALUE="65536"><PARAM NAME="_ExtentX" VALUE="0"><PARAM NAME="_ExtentY" VALUE="0"><PARAM NAME="_StockProps" VALUE="0"><PARAM NAME="LoginComponent" VALUE="ActiveXSuite"></OBJECT>
  124. <DIV ID=TableHeader style="VISIBILITY: hidden">
  125. <P><FONT color=darkgreen face=Verdana size=5>Property Table</FONT></P>
  126. <TABLE ID=ClassTable align=left bgColor=tan border=1 borderColor=saddlebrown cellPadding=1 cellSpacing=1
  127. width=100%>
  128. <THEAD>
  129. <TR>
  130. <TD align=middle><EM>Property Name</EM></TD>
  131. <TD align=middle><EM>Property Type</EM></TD>
  132. <TD align=middle><EM>Property Origin</EM></TD>
  133. </TR>
  134. <TBODY></TBODY>
  135. </TABLE>
  136. </DIV>
  137. </BODY></HTML>