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.

72 lines
2.2 KiB

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