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.

645 lines
22 KiB

  1. <HTML>
  2. <OBJECT width=0 height=0 ID=pchealth classid=CLSID:FC7D9E02-3F9E-11d3-93C0-00C04F72DAF7></OBJECT>
  3. <SCRIPT language=VBScript>
  4. Set fsoObject = CreateObject("Scripting.FileSystemObject")
  5. Set shellObject = CreateObject("Wscript.Shell")
  6. Dim strOpenedTime
  7. Dim strClosedTime
  8. Dim incidentItemObject
  9. Dim channelObject
  10. Dim incidentObject
  11. Const pchAllIncidents = 1
  12. Const pchOpenIncidents = 2
  13. Const pchClosedIncidents = 3
  14. Const pchIncidentOpen = 1
  15. Const pchIncidentClosed = 2
  16. Const WindowsFolder = 0
  17. Const SystemFolder = 1
  18. Const TemporaryFolder = 2
  19. strVendorID = "CN=Microsoft Corporation,L=Redmond,S=Washington,C=US"
  20. strProductID = "Microsoft Millennium Beta"
  21. strWindowsFolder = fsoObject.GetSpecialFolder(WindowsFolder)
  22. strSystemFolder = fsoObject.GetSpecialFolder(SystemFolder)
  23. strTemporaryFolder = fsoObject.GetSpecialFolder(TemporaryFolder)
  24. intUniqueNumber = getUniqueNumber()
  25. strNewIncidentURL = "http://" & intUniqueNumber
  26. strNewIncidentDisplay = "This is an IDW Test incident " & strURL
  27. strSetFirstNewDisplayString = "New First IDW Display String " & intUniqueNumber
  28. strSetFirstNewURL = "http://IDW_FIRST_URL_CHANGE_TEST/" & intUniqueNumber
  29. strSetSecondNewDisplayString = "New Second IDW Display String " & intUniqueNumber
  30. strSetSecondNewURL = "http://IDW_SECOND_URL_CHANGE_TEST/" & intUniqueNumber
  31. intIncidentIndexNumber = 0
  32. strIncidentObjectUserName = "Incident Object User Name"
  33. strIncidentObjectProductID = "Incident Object Product ID #1234567890"
  34. strIncidentObjectProductName = "Incident Object Product Name"
  35. strIncidentObjectProblemDescription = "Incident Object Problem Description, 1234567890"
  36. strIncidentObjectFileName = strTemporaryFolder & "\incidentObjectTestFile.txt"
  37. Set channelObject = pchealth.CreateObject_channel(strVendorID, strProductID)
  38. Set incidentObject = pchealth.CreateObject_Incident()
  39. CloseAllIncidents()
  40. GetVendorID()
  41. GetProductID()
  42. GetVendorName()
  43. GetProductName()
  44. document.write "Inital Incident Count: <BR>"
  45. document.write "No Result Is Expected <BR>"
  46. intOriginalGetAllIncidentsCount = GetAllIncidentsCount()
  47. intOriginalGetOpenIncidentsCount = GetOpenIncidentsCount()
  48. intOriginalGetClosedIncidentsCount = GetClosedIncidentsCount()
  49. document.write "<HR>"
  50. 'Record a new incident here
  51. strReturnedNewIncidentURL = RecordNewIncident(strNewIncidentURL, strNewIncidentDisplay)
  52. sortAllIncidents()
  53. CheckIncidentStatus(pchIncidentOpen)
  54. SetNewDisplayString(strSetFirstNewDisplayString)
  55. SetNewURL(strSetFirstNewURL)
  56. CloseNewIncident(strReturnedNewIncidentURL)
  57. CheckIncidentStatus(pchIncidentClosed)
  58. SetNewDisplayString(strSetSecondNewDisplayString)
  59. SetNewURL(strSetSecondNewURL)
  60. CheckCreationTime(strOpenedTime)
  61. CheckClosedTime(strClosedTime)
  62. incidentObjectBinFileSave()
  63. incidentObjectBinFileLoad()
  64. Public Sub incidentObjectBinFileLoad()
  65. incidentObject.Load strIncidentObjectFileName
  66. strReturnedIncidentObjectUserName = incidentObject.UserName
  67. strReturnedIncidentObjectProductID = incidentObject.ProductID
  68. strReturnedIncidentObjectProductName = incidentObject.ProductName
  69. strReturnedIncidentObjectProblemDescription = incidentObject.ProblemDescription
  70. document.write "Load Incident Object Information From Bin File<BR>"
  71. document.write "Returned User Name: " & strReturnedIncidentObjectUserName & "<BR>"
  72. document.write "Returned Product ID: " & strReturnedIncidentObjectProductID & "<BR>"
  73. document.write "Returned Product Name: " & strReturnedIncidentObjectProductName & "<BR>"
  74. document.write "Returned Problem Description: " & strReturnedIncidentObjectProblemDescription & "<BR>"
  75. If strReturnedIncidentObjectUserName = strIncidentObjectUserName Then
  76. strReturnedIncidentObjectUserNameResult = "<li>User Name Match Result: <FONT color=green><STRONG>Pass</STRONG></FONT> <BR>"
  77. Else
  78. strReturnedIncidentObjectUserNameResult = "<li>User Name Match Test Result: <FONT color=red><STRONG>Fail</STRONG></FONT> <BR>"
  79. End If
  80. If strReturnedIncidentObjectProductID = strIncidentObjectProductID Then
  81. strReturnedIncidentObjectProductIDResult = "<li>Product ID Match Result: <FONT color=green><STRONG>Pass</STRONG></FONT> <BR>"
  82. Else
  83. strReturnedIncidentObjectProductIDResult = "<li>Product ID Match Test Result: <FONT color=red><STRONG>Fail</STRONG></FONT> <BR>"
  84. End If
  85. If strReturnedIncidentObjectProductName = strIncidentObjectProductName Then
  86. strReturnedIncidentObjectProductNameResult = "<li>Product Name Match Result: <FONT color=green><STRONG>Pass</STRONG></FONT> <BR>"
  87. Else
  88. strReturnedIncidentObjectProductNameResult = "<li>Product Name Match Test Result: <FONT color=red><STRONG>Fail</STRONG></FONT> <BR>"
  89. End If
  90. If strReturnedIncidentObjectProblemDescription = strIncidentObjectProblemDescription Then
  91. strReturnedIncidentObjectProblemDescriptionResult = "<li>Problem Description Match Result: <FONT color=green><STRONG>Pass</STRONG></FONT> <BR>"
  92. Else
  93. strReturnedIncidentObjectProblemDescriptionResult = "<li>Problem Description Match Test Result: <FONT color=red><STRONG>Fail</STRONG></FONT> <BR>"
  94. End If
  95. document.write strReturnedIncidentObjectUserNameResult
  96. document.write strReturnedIncidentObjectProductIDResult
  97. document.write strReturnedIncidentObjectProductNameResult
  98. document.write strReturnedIncidentObjectProblemDescriptionResult
  99. document.write "<HR>"
  100. End Sub
  101. Public Sub incidentObjectBinFileSave()
  102. document.write "Save Incident Object Information to Bin File<BR>"
  103. document.write "User Name: " & strIncidentObjectUserName & "<BR>"
  104. document.write "Product ID: " & strIncidentObjectProductID & "<BR>"
  105. document.write "Product Name: " & strIncidentObjectProductName & "<BR>"
  106. document.write "Problem Description: " & strIncidentObjectProblemDescription & "<BR>"
  107. If fsoObject.FileExists(strIncidentObjectFileName) Then
  108. fsoObject.DeleteFile(strIncidentObjectFileName)
  109. End If
  110. incidentObject.UserName = strIncidentObjectUserName
  111. incidentObject.ProductID = strIncidentObjectProductID
  112. incidentObject.ProductName = strIncidentObjectProductName
  113. incidentObject.ProblemDescription = strIncidentObjectProblemDescription
  114. incidentObject.Save strIncidentObjectFileName
  115. document.write "File Name: " & strIncidentObjectFileName & "<BR>"
  116. End Sub
  117. Public Sub CheckIncidentStatus(intStatusShouldBe)
  118. Err.Clear
  119. On Error Resume Next
  120. intReturnedStatus = incidentItemObject.Status
  121. document.write "Current Status Test<BR>"
  122. document.write "Status Should Be: " & intStatusShouldBe & "<BR>"
  123. document.write "Returned status: " & intReturnedStatus & "<BR>"
  124. If intReturnedStatus = intStatusShouldBe Then
  125. strStatusTestResult = "<li>Status Returned Match Result: <FONT color=green><STRONG>Pass</STRONG></FONT> <BR>"
  126. Else
  127. strStatusTestResult = "<li>Status Returned Match Test Result: <FONT color=red><STRONG>Fail</STRONG></FONT> <BR>"
  128. End If
  129. document.write strStatusTestResult
  130. If Err.number <> 0 Then
  131. document.write Err.number & " : " & Err.description & "<BR>"
  132. End If
  133. document.write "<HR>"
  134. Err.Clear
  135. End Sub
  136. Public Sub CheckClosedTime(strClosedTime)
  137. Err.Clear
  138. On Error Resume Next
  139. strReturnedClosedTime = incidentItemObject.ClosedTime
  140. document.write "Closed Time Test<BR>"
  141. document.write "Closed Time: " & strClosedTime & "<BR>"
  142. document.write "Returned Closed Time: " & strReturnedClosedTime & "<BR>"
  143. If strReturnedClosedTime = strOpenedTime Then
  144. strClosedTimeTestResult = "<li>ClosedTime Returned Match Result: <FONT color=green><STRONG>Pass</STRONG></FONT> <BR>"
  145. Else
  146. strClosedTimeTestResult = "<li>ClosedTime Returned Match Test Result: <FONT color=red><STRONG>Fail</STRONG></FONT> <BR>"
  147. End If
  148. document.write strClosedTimeTestResult
  149. document.write Err.number & " : " & Err.description & "<BR>"
  150. document.write "<HR>"
  151. Err.Clear
  152. End Sub
  153. Public Sub CheckCreationTime(strOpenedTime)
  154. strReturnedCreationTime = incidentItemObject.CreationTime
  155. document.write "Creation Time Test<BR>"
  156. document.write "Opened Time: " & strOpenedTime & "<BR>"
  157. document.write "Returned Creation Time: " & strReturnedCreationTime & "<BR>"
  158. If strReturnedCreationTime = strOpenedTime Then
  159. strCreationTimeTestResult = "<li>Creation Time Returned Match Result: <FONT color=green><STRONG>Pass</STRONG></FONT> <BR>"
  160. Else
  161. strCreationTimeTestResult = "<li>Creation Time Returned Match Test Result: <FONT color=red><STRONG>Fail</STRONG></FONT> <BR>"
  162. End If
  163. document.write strCreationTimeTestResult
  164. document.write "<HR>"
  165. End Sub
  166. Public Function getUniqueNumber()
  167. strUniqueNumber = Second(Now) & Minute(Now) & Hour(Now) & Int((Second(Now) & Minute(Now) & Hour(Now)) * Rnd)
  168. getUniqueNumber = strUniqueNumber
  169. End Function
  170. Public Sub SetNewURL(strSetNewURL)
  171. document.write "Set New URL Test<BR>"
  172. strOriginalURL = incidentItemObject.URL
  173. incidentItemObject.URL = strSetNewURL
  174. strNewReturnedURL = incidentItemObject.URL
  175. document.write "Original Returned String: " & strOriginalURL & "<BR>"
  176. document.write "New String: " & strNewReturnedURL & "<BR>"
  177. checkURLChangeResults strOriginalURL, strNewReturnedURL, strSetNewURL
  178. document.write "<HR>"
  179. End Sub
  180. Public Sub CheckURLChangeResults(strOriginalURL, strNewReturnedURL, strSetNewURL)
  181. strMethodToVerify = "URL"
  182. If strOriginalURL = strNewReturnedURL Then
  183. strURLDifferentResult = "<li>URL Returned Different Test Result: <FONT color=red><STRONG>Fail</STRONG></FONT> <BR>"
  184. Else
  185. strURLDifferentResult = "<li>URL Returned Different Result: <FONT color=green><STRONG>Pass</STRONG></FONT> <BR>"
  186. End If
  187. If strNewReturnedURL = strSetNewURL Then
  188. strURLMatchResult = "<li>URL Returned Match Result: <FONT color=green><STRONG>Pass</STRONG></FONT> <BR>"
  189. Else
  190. strURLMatchResult = "<li>URL Returned Match Test Result: <FONT color=red><STRONG>Fail</STRONG></FONT> <BR>"
  191. End If
  192. If strNewReturnedURL = VerifyChangeWithOtherObject(strMethodToVerify) Then
  193. strOtherObjectURLMatchResult = "<li>URL Other Object Check Match Result: <FONT color=green><STRONG>Pass</STRONG></FONT> <BR>"
  194. Else
  195. strOtherObjectURLMatchResult = "<li>URL Other Object Check Match Test Result: <FONT color=red><STRONG>Fail</STRONG></FONT> <BR>"
  196. End If
  197. document.write strURLDifferentResult
  198. document.write strURLMatchResult
  199. document.write strOtherObjectURLMatchResult
  200. End Sub
  201. Public Sub CloseAllIncidents()
  202. Err.Clear
  203. set channelIncidents = channelObject.Incidents(pchOpenIncidents)
  204. If Err.Number = 0 Then
  205. If channelIncidents.Count > 0 Then
  206. i = 0
  207. For Each oItem in channelIncidents
  208. Set incidentItemObject = channelIncidents.Item(i)
  209. strURL = incidentItemObject.URL
  210. document.write "<BR>"
  211. document.write strURL & "<BR>"
  212. channelObject.CloseIncident strURL
  213. strClosedURL = incidentItemObject.URL
  214. document.write strClosedURL
  215. i = i + 1
  216. Next
  217. End If
  218. End If
  219. Err.Clear
  220. End Sub
  221. Public Function VerifyChangeWithOtherObject(strMethodToVerify)
  222. Set tempChannelObject = pchealth.CreateObject_channel(strVendorID, strProductID)
  223. set tempChannelIncidents = tempChannelObject.Incidents(pchAllIncidents)
  224. Err.Clear
  225. If Err.Number = 0 Then
  226. If tempChannelIncidents.Count > 0 Then
  227. ' This is where we start to sort
  228. Dim arrayCount
  229. Dim sortTemp
  230. ReDim sortTemp(tempChannelIncidents.Count)
  231. arrayCount = 0
  232. For Each oItem in tempChannelIncidents
  233. set sortTemp(arrayCount) = oItem
  234. arrayCount = arrayCount + 1
  235. Next
  236. 'Sort Here
  237. For arrayCount = o to tempChannelIncidents.Count - 2
  238. For arraySortCount = arrayCount + 1 to tempChannelIncidents.Count - 1
  239. If sortTemp(arrayCount).CreationTime < sortTemp(arraySortCount).CreationTime Then
  240. Dim additionalSortTemp
  241. Set additionalSortTemp = sortTemp(arrayCount)
  242. Set sortTemp(arrayCount) = sortTemp(arraySortCount)
  243. Set sortTemp(arraySortCount) = additionalSortTemp
  244. End If
  245. Next
  246. Next
  247. End If
  248. End If
  249. Err.Clear
  250. Set tempIncidentItemObject = tempChannelIncidents.Item(intIncidentIndexNumber)
  251. If strMethodToVerify = "DisplayString" Then
  252. strResult = tempIncidentItemObject.DisplayString
  253. document.write "Other Object Return Check: " & strResult & "<BR>"
  254. VerifyChangeWithOtherObject = strResult
  255. ElseIf strMethodToVerify = "URL" Then
  256. strResult = tempIncidentItemObject.URL
  257. document.write "Other Object Return Check: " & strResult & "<BR>"
  258. VerifyChangeWithOtherObject = strResult
  259. ElseIf strMethodToVerify = "Status" Then
  260. strResult = tempIncidentItemObject.Status
  261. document.write "Other Object Return Check: " & strResult & "<BR>"
  262. VerifyChangeWithOtherObject = strResult
  263. Else
  264. document.write "<FONT color=red><STRONG>Error checking other object</STRONG></FONT> <BR>"
  265. End If
  266. End Function
  267. Public Sub SetNewDisplayString(strSetNewDisplayString)
  268. document.write "Set New Display String Test<BR>"
  269. strOriginalDisplayString = incidentItemObject.DisplayString
  270. incidentItemObject.DisplayString = strSetNewDisplayString
  271. strNewReturnedDisplayString = incidentItemObject.DisplayString
  272. document.write "Original Returned String: " & strOriginalDisplayString & "<BR>"
  273. document.write "New String: " & strNewReturnedDisplayString & "<BR>"
  274. CheckDisplayStringResults strOriginalDisplayString, strNewReturnedDisplayString, strSetNewDisplayString
  275. document.write "<HR>"
  276. End Sub
  277. Public Sub CheckDisplayStringResults(strOriginalDisplayString, strNewReturnedDisplayString, strSetNewDisplayString)
  278. strMethodToVerify = "DisplayString"
  279. If strOriginalDisplayString = strNewReturnedDisplayString Then
  280. strDisplayStringDifferentResult = "<li>Display Returned String Different Test Result: <FONT color=red><STRONG>Fail</STRONG></FONT> <BR>"
  281. Else
  282. strDisplayStringDifferentResult = "<li>Display Returned String Different Result: <FONT color=green><STRONG>Pass</STRONG></FONT> <BR>"
  283. End If
  284. If strNewReturnedDisplayString = strSetNewDisplayString Then
  285. strDisplayStringMatchResult = "<li>Display Returned String Match Result: <FONT color=green><STRONG>Pass</STRONG></FONT> <BR>"
  286. Else
  287. strDisplayStringMatchResult = "<li>Display Returned String Match Test Result: <FONT color=red><STRONG>Fail</STRONG></FONT> <BR>"
  288. End If
  289. If strNewReturnedDisplayString = VerifyChangeWithOtherObject(strMethodToVerify) Then
  290. strOtherObjectDisplayStringMatchResult = "<li>Display Other Object Check String Match Result: <FONT color=green><STRONG>Pass</STRONG></FONT> <BR>"
  291. Else
  292. strOtherObjectDisplayStringMatchResult = "<li>Display Other Object Check String Match Test Result: <FONT color=red><STRONG>Fail</STRONG></FONT> <BR>"
  293. End If
  294. document.write strDisplayStringDifferentResult
  295. document.write strDisplayStringMatchResult
  296. document.write strOtherObjectDisplayStringMatchResult
  297. End Sub
  298. Public Sub sortAllIncidents()
  299. Err.Clear
  300. set channelIncidents = channelObject.Incidents(pchAllIncidents)
  301. If Err.Number = 0 Then
  302. If channelIncidents.Count > 0 Then
  303. ' This is where we start to sort
  304. Dim arrayCount
  305. Dim sortTemp
  306. ReDim sortTemp(channelIncidents.Count)
  307. arrayCount = 0
  308. For Each oItem in channelIncidents
  309. set sortTemp(arrayCount) = oItem
  310. arrayCount = arrayCount + 1
  311. Next
  312. 'Sort Here
  313. For arrayCount = o to channelIncidents.Count - 2
  314. For arraySortCount = arrayCount + 1 to channelIncidents.Count - 1
  315. If sortTemp(arrayCount).CreationTime < sortTemp(arraySortCount).CreationTime Then
  316. Dim additionalSortTemp
  317. Set additionalSortTemp = sortTemp(arrayCount)
  318. Set sortTemp(arrayCount) = sortTemp(arraySortCount)
  319. Set sortTemp(arraySortCount) = additionalSortTemp
  320. End If
  321. Next
  322. Next
  323. End If
  324. End If
  325. Err.Clear
  326. Set incidentItemObject = channelIncidents.Item(intIncidentIndexNumber)
  327. End Sub
  328. Public Sub CloseNewIncident(strReturnedNewIncidentURL)
  329. document.write "Close New Incident Test<BR>"
  330. channelObject.CloseIncident strReturnedNewIncidentURL
  331. strClosedTime = Now
  332. intNewOpenIncidentCount = GetOpenIncidentsCount()
  333. intNewClosedIncidentCount = GetClosedIncidentsCount()
  334. intNewAllIncidentCount = GetAllIncidentsCount()
  335. If intNewOpenIncidentCount = (intOriginalGetOpenIncidentsCount) Then
  336. strOpenIncidentCountResult = "<li>New Open Incident Count Result: <FONT color=green><STRONG>Pass</STRONG></FONT> <BR>"
  337. Else
  338. strOpenIncidentCountResult = "<li>New Open Incident Count Result: <FONT color=red><STRONG>Fail</STRONG></FONT> <BR>"
  339. End If
  340. document.write strOpenIncidentCountResult
  341. If intNewClosedIncidentCount = (intOriginalGetClosedIncidentsCount + 1) Then
  342. strClosedIncidentCountResult = "<li>New Closed Incident Count Result: <FONT color=green><STRONG>Pass</STRONG></FONT> <BR>"
  343. Else
  344. strClosedIncidentCountResult = "<li>New Closed Incident Count Result: <FONT color=red><STRONG>Fail</STRONG></FONT> <BR>"
  345. End If
  346. document.write strClosedIncidentCountResult
  347. If intNewAllIncidentCount = (intNewClosedIncidentCount + intNewOpenIncidentCount) Then
  348. strAllIncidentCountResult = "<li>New All Incident Count Result: <FONT color=green><STRONG>Pass</STRONG></FONT> <BR>"
  349. Else
  350. strAllIncidentCountResult = "<li>New All Incident Count Result: <FONT color=red><STRONG>Fail</STRONG></FONT> <BR>"
  351. End If
  352. document.write strAllIncidentCountResult
  353. document.write "<HR>"
  354. End Sub
  355. Public Function RecordNewIncident(strNewIncidentURL, strNewIncidentDisplay)
  356. document.write "Record New Incident Test<BR>"
  357. channelObject.RecordIncident strNewIncidentDisplay, strNewIncidentURL
  358. strOpenedTime = Now
  359. intNewOpenIncidentCount = GetOpenIncidentsCount()
  360. intNewClosedIncidentCount = GetClosedIncidentsCount()
  361. intNewAllIncidentCount = GetAllIncidentsCount()
  362. If intNewOpenIncidentCount = (intOriginalGetOpenIncidentsCount + 1) Then
  363. strOpenIncidentCountResult = "<li>New Open Incident Count Result: <FONT color=green><STRONG>Pass</STRONG></FONT> <BR>"
  364. Else
  365. strOpenIncidentCountResult = "<li>New Open Incident Count Result: <FONT color=red><STRONG>Fail</STRONG></FONT> <BR>"
  366. End If
  367. document.write strOpenIncidentCountResult
  368. If intNewClosedIncidentCount = (intOriginalGetClosedIncidentsCount + 1) Then
  369. strClosedIncidentCountResult = "<li>New Closed Incident Count Result: <FONT color=red><STRONG>Fail</STRONG></FONT> <BR>"
  370. Else
  371. strClosedIncidentCountResult = "<li>New Closed Incident Count Result: <FONT color=green><STRONG>Pass</STRONG></FONT> <BR>"
  372. End If
  373. document.write strClosedIncidentCountResult
  374. If intNewAllIncidentCount = (intOriginalGetAllIncidentsCount + 1) Then
  375. strAllIncidentCountResult = "<li>New All Incident Count Result: <FONT color=green><STRONG>Pass</STRONG></FONT> <BR>"
  376. Else
  377. strAllIncidentCountResult = "<li>New All Incident Count Result: <FONT color=red><STRONG>Fail</STRONG></FONT> <BR>"
  378. End If
  379. document.write strAllIncidentCountResult
  380. RecordNewIncident = strNewIncidentURL
  381. document.write "<HR>"
  382. End Function
  383. Public Function GetClosedIncidentsCount()
  384. set channelIncidents = channelObject.Incidents(pchClosedIncidents)
  385. intClosedIncidentsCount = channelIncidents.Count
  386. document.write "Closed Incidents Count: " & intClosedIncidentsCount & "<BR>"
  387. GetClosedIncidentsCount = intClosedIncidentsCount
  388. End Function
  389. Public Function GetOpenIncidentsCount()
  390. set channelIncidents = channelObject.Incidents(pchOpenIncidents)
  391. intOpenIncidentsCount = channelIncidents.Count
  392. document.write "Open Incidents Count: " & intOpenIncidentsCount & "<BR>"
  393. GetOpenIncidentsCount = intOpenIncidentsCount
  394. End Function
  395. Public Function GetAllIncidentsCount()
  396. set channelIncidents = channelObject.Incidents(pchAllIncidents)
  397. intAllIncidentsCount = channelIncidents.Count
  398. document.write "All Incidents Count: " & intAllIncidentsCount & "<BR>"
  399. GetAllIncidentsCount = intAllIncidentsCount
  400. End Function
  401. Public Sub GetProductName()
  402. document.write "Get Product Name Test <BR>"
  403. strProductNameOut = channelObject.ProductName
  404. strRegProductName = shellObject.RegRead("HKLM\Software\Microsoft\PCHealth\HelpCenter\SAF\Channel\" & strVendorID & "\" & strProductID & "\Description")
  405. document.write "From Channel.ProductName: " & strProductNameOut & "<BR>"
  406. document.write "From Registry: " & strRegProductName & "<BR>"
  407. If strProductNameOut = strRegProductName Then
  408. strGetProductNameResult = "<li>GetProductName Result: <FONT color=green><STRONG>Pass</STRONG></FONT> <BR>"
  409. Else
  410. strGetProductNameResult = "<li>GetProductName Result: <FONT color=red><STRONG>Fail</STRONG></FONT> <BR>"
  411. End If
  412. document.write strGetProductNameResult
  413. document.write "<HR>"
  414. End Sub
  415. Public Sub GetVendorName()
  416. document.write "Get Vendor Name Test <BR>"
  417. strVendorNameOut = channelObject.VendorName
  418. strRegVendorName = shellObject.RegRead("HKLM\Software\Microsoft\PCHealth\HelpCenter\SAF\Channel\" & strVendorID & "\CompanyName")
  419. document.write "From Channel.VendorName: " & strVendorNameOut & "<BR>"
  420. document.write "From Registry: " & strRegVendorName & "<BR>"
  421. If strVendorNameOut = strRegVendorName Then
  422. strGetVendorNameResult = "<li>GetVendorName Result: <FONT color=green><STRONG>Pass</STRONG></FONT> <BR>"
  423. Else
  424. strGetVendorNameResult = "<li>GetVendorName Result: <FONT color=red><STRONG>Fail</STRONG></FONT> <BR>"
  425. End If
  426. document.write strGetVendorNameResult
  427. document.write "<HR>"
  428. End Sub
  429. Public Sub GetProductID()
  430. document.write "Get Product ID Test <BR>"
  431. strProductIDOut = channelObject.ProductID
  432. Document.Write "From Channel.ProductID: " & strProductIDOut & "<BR>"
  433. Document.Write "From Registry: " & strProductID & "<BR>"
  434. If strProductIDOut = strProductID Then
  435. strGetProductIDResult = "<li>GetProductID Result: <FONT color=green><STRONG>Pass</STRONG></FONT> <BR>"
  436. Else
  437. strGetProductIDResult = "<li>GetProductID Result: <FONT color=red><STRONG>Fail</STRONG></FONT> <BR>"
  438. End If
  439. document.write strGetProductIDResult
  440. document.write "<HR>"
  441. End Sub
  442. Public Sub GetVendorID()
  443. document.write "Get Vendor ID Test <BR>"
  444. strVendorIdOut = channelObject.VendorID
  445. Document.Write "From Channel.VendorID: " & strVendorIdOut & "<BR>"
  446. Document.Write "Vendor ID: " & strVendorID & "<BR>"
  447. If strVendorIdOut = strVendorID Then
  448. strGetVendorIDResult = "<li>VendorID Test Result: <FONT color=green><STRONG>Pass</STRONG></FONT> <BR>"
  449. Else
  450. strGetVendorIDResult = "<li>VendorID Test Result: <FONT color=red><STRONG>Fail</STRONG></FONT> <BR>"
  451. End If
  452. Document.write strGetVendorIDResult
  453. document.write "<HR>"
  454. End Sub
  455. </Script>
  456. </HTML>