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.

77 lines
2.2 KiB

  1. <HTML>
  2. <HEAD>
  3. <TITLE>Loop through all keys</TITLE>
  4. </HEAD>
  5. <BODY>
  6. <%
  7. Dim MetaUtil
  8. Dim Keys
  9. Dim i
  10. Dim Key
  11. 'Create the MetaUtil object
  12. Set MetaUtil = Server.CreateObject("MSWC.MetaUtil.1")
  13. 'Count then enumberate with a base Key of ""
  14. Response.Write("<FONT SIZE=+1>Base key of """" </FONT><br>" + CHR(13) + CHR(10))
  15. Response.Write("<br>" + CHR(13) + CHR(10))
  16. Set Keys = MetaUtil.EnumAllKeys("")
  17. Response.Write("Count the Keys:<br>" + CHR(13) + CHR(10))
  18. Response.Write(Keys.Count)
  19. Response.Write("<br>" + CHR(13) + CHR(10))
  20. Response.Write("<br>" + CHR(13) + CHR(10))
  21. Response.Write("Loop through the Keys:<br>" + CHR(13) + CHR(10))
  22. For i = 1 To Keys.Count
  23. Response.Write(Keys.Item(i))
  24. Response.Write("<br>" + CHR(13) + CHR(10))
  25. Next
  26. Response.Write("<br>" + CHR(13) + CHR(10))
  27. Response.Write("Loop through the Keys (backwards):<br>" + CHR(13) + CHR(10))
  28. For i = Keys.Count To 1 Step -1
  29. Response.Write(Keys.Item(i))
  30. Response.Write("<br>" + CHR(13) + CHR(10))
  31. Next
  32. Response.Write("<br>" + CHR(13) + CHR(10))
  33. 'Count then enumberate with a base Key of "LM/Schema/Classes"
  34. Response.Write("<FONT SIZE=+1>Base key of ""LM/Schema/Classes"" </FONT><br>" + CHR(13) + CHR(10))
  35. Response.Write("<br>" + CHR(13) + CHR(10))
  36. Set Keys = MetaUtil.EnumAllKeys("LM/Schema/Classes")
  37. Response.Write("Count the Keys:<br>" + CHR(13) + CHR(10))
  38. Response.Write(Keys.Count)
  39. Response.Write("<br>" + CHR(13) + CHR(10))
  40. Response.Write("<br>" + CHR(13) + CHR(10))
  41. Response.Write("Loop through the Keys:<br>" + CHR(13) + CHR(10))
  42. For i = 1 To Keys.Count
  43. Response.Write(Keys.Item(i))
  44. Response.Write("<br>" + CHR(13) + CHR(10))
  45. Next
  46. Response.Write("<br>" + CHR(13) + CHR(10))
  47. Response.Write("Loop through the Keys (backwards):<br>" + CHR(13) + CHR(10))
  48. For i = Keys.Count To 1 Step -1
  49. Response.Write(Keys.Item(i))
  50. Response.Write("<br>" + CHR(13) + CHR(10))
  51. Next
  52. Response.Write("<br>" + CHR(13) + CHR(10))
  53. Response.Write("Done<br>")
  54. 'Clean up the reference to IIS.MetaUtil
  55. Session.Abandon
  56. %>
  57. </BODY>
  58. </HTML>