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
162 lines
4.3 KiB
<HTML>
|
|
<HEAD>
|
|
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
|
|
<TITLE></TITLE>
|
|
<SCRIPT LANGUAGE="VBS">
|
|
Dim Locator
|
|
Dim Service
|
|
Dim Class
|
|
</SCRIPT>
|
|
|
|
|
|
<SCRIPT LANGUAGE="VBS">
|
|
<!--
|
|
|
|
Sub window_onload()
|
|
'Create the scriptable locator
|
|
Set Locator = CreateObject ("WbemScripting.SWBemLocator")
|
|
ClassNav.OnReadySignal ()
|
|
TableHeader.style.visibility = "hidden"
|
|
End Sub
|
|
|
|
//-->
|
|
</SCRIPT>
|
|
|
|
<SCRIPT LANGUAGE="VBS">
|
|
<!--
|
|
|
|
Function TypeAsString (Property)
|
|
TypeAsString = "uint32"
|
|
|
|
select case Property.cimType
|
|
Case 16
|
|
TypeAsString = "sint8"
|
|
Case 17
|
|
TypeAsString = "uint8"
|
|
Case 2
|
|
TypeAsString = "sint16"
|
|
Case 18
|
|
TypeAsString = "uint16"
|
|
Case 3
|
|
TypeAsString = "uint32"
|
|
Case 20
|
|
TypeAsString = "sint64"
|
|
Case 21
|
|
TypeAsString = "uint64"
|
|
Case 4
|
|
TypeAsString = "real32"
|
|
Case 5
|
|
TypeAsString = "real64"
|
|
Case 11
|
|
TypeAsString = "boolean"
|
|
Case 8
|
|
TypeAsString = "string"
|
|
Case 101
|
|
TypeAsString = "datetime"
|
|
Case 102
|
|
TypeAsString = "ref"
|
|
Set Qualifier = Property.Qualifiers_("cimtype")
|
|
StrongRefArray = Split(Qualifier.Value,":")
|
|
|
|
if (UBound(StrongRefArray) > 0) then
|
|
TypeAsString = TypeAsString & " " & StrongRefArray(1)
|
|
end if
|
|
Case 103
|
|
TypeAsString = "char16"
|
|
Case 13
|
|
TypeAsString = "object"
|
|
Set Qualifier = Property.Qualifiers_("cimtype")
|
|
StrongObjArray = Split(Qualifier.Value,":")
|
|
|
|
if (UBound(StrongObjArray) > 0) then
|
|
TypeAsString = TypeAsString & " " & StrongObjArray(1)
|
|
end if
|
|
end select
|
|
|
|
if Property.isArray = true then
|
|
TypeAsString = TypeAsString & " []"
|
|
end if
|
|
|
|
End Function
|
|
|
|
Sub ClassNav_EditExistingClass(selObj)
|
|
on error resume next
|
|
Dim classStr
|
|
Dim Property
|
|
Dim CIMClass
|
|
|
|
ErrorMessage.innerText = ""
|
|
|
|
'Clear the table (apart from the first row)
|
|
TableHeader.style.visibility = "hidden"
|
|
while (ClassTable.rows.length > 1)
|
|
ClassTable.deleteRow()
|
|
wend
|
|
|
|
Set CIMClass = Service.Get (selObj)
|
|
|
|
for each Property in CIMClass.Properties_
|
|
Set row = ClassTable.insertRow
|
|
row.insertCell().innerText = Property.Name
|
|
row.insertCell().innerText = TypeAsString (Property)
|
|
row.insertCell().innerText = Property.Origin
|
|
next
|
|
|
|
ClassTable.refresh
|
|
TableHeader.style.visibility = "visible"
|
|
|
|
if err <> 0 then
|
|
ErrorMessage.innerText = "Error: " & Err.description & " - " & Err.source
|
|
end if
|
|
End Sub
|
|
|
|
Sub ClassNav_NotifyOpenNameSpace(theNameSpace)
|
|
Set Service = Locator.ConnectServer (,theNamespace)
|
|
End Sub
|
|
|
|
Sub ClassNav_GetIWbemServices(lpctstrNamespace, bUpdatePointer, lpsc, lppServices, lpbUserCancel)
|
|
Login.GetIWbemServices lpctstrNamespace, bUpdatePointer, lpsc, lppServices, lpbUserCancel
|
|
Set Service = Locator.ConnectServer (,lpctstrNamespace)
|
|
End Sub
|
|
-->
|
|
</SCRIPT>
|
|
</HEAD>
|
|
<BODY LANGUAGE=javascript onload="return window_onload()" bgColor=silver>
|
|
|
|
<P align=center><STRONG><FONT face=Verdana size=5>WBEM ActiveX Control & Scripting
|
|
Demo</FONT></STRONG>
|
|
</P>
|
|
|
|
<P><FONT color=darkgreen face=Verdana size=5>Select a Class:</FONT>
|
|
</P>
|
|
|
|
<P>
|
|
<OBJECT classid=clsid:C587B673-0103-11D0-8CA2-00AA006D010A
|
|
codeBase=http://alanbos3/wbem/WBEMTool.cab#Version=1,01,525,0000 height=304 id=ClassNav
|
|
style="HEIGHT: 304px; LEFT: 0px; TOP: 0px; WIDTH: 808px" width=97.35%
|
|
VIEWASTEXT>
|
|
<PARAM NAME="_Version" VALUE="65536">
|
|
<PARAM NAME="_ExtentX" VALUE="21379">
|
|
<PARAM NAME="_ExtentY" VALUE="8043">
|
|
<PARAM NAME="_StockProps" VALUE="0">
|
|
<PARAM NAME="NameSpace" VALUE="">
|
|
</OBJECT>
|
|
</P>
|
|
<OBJECT classid=clsid:9C3497D6-ED98-11D0-9647-00C04FD9B15B
|
|
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>
|
|
|
|
<DIV ID=TableHeader style="VISIBILITY: hidden">
|
|
<P><FONT color=darkgreen face=Verdana size=5>Property Table</FONT></P>
|
|
<TABLE ID=ClassTable align=left bgColor=tan border=1 borderColor=saddlebrown cellPadding=1 cellSpacing=1
|
|
width=100%>
|
|
<THEAD>
|
|
<TR>
|
|
<TD align=middle><EM>Property Name</EM></TD>
|
|
<TD align=middle><EM>Property Type</EM></TD>
|
|
<TD align=middle><EM>Property Origin</EM></TD>
|
|
</TR>
|
|
<TBODY></TBODY>
|
|
</TABLE>
|
|
</DIV>
|
|
|
|
</BODY></HTML>
|