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.

65 lines
1.6 KiB

  1. <HTML>
  2. <HEAD>
  3. <TITLE>Add then delete a key</TITLE>
  4. </HEAD>
  5. <BODY>
  6. <%
  7. Dim MetaUtil
  8. Dim Keys
  9. Dim Key
  10. 'Create the MetaUtil object
  11. Set MetaUtil = Server.CreateObject("MSWC.MetaUtil.1")
  12. 'Base Key of "LM/W3SVC"
  13. Response.Write("<FONT SIZE=+1>Base key of ""LM/W3SVC"" </FONT><br>" + CHR(13) + CHR(10))
  14. Response.Write("<br>" + CHR(13) + CHR(10))
  15. Set Keys = MetaUtil.EnumKeys("LM/W3SVC")
  16. 'Enumerate the keys
  17. Response.Write("Enumerate the Keys:<br>" + CHR(13) + CHR(10))
  18. For Each Key In Keys
  19. Response.Write(Key)
  20. Response.Write("<br>" + CHR(13) + CHR(10))
  21. Next
  22. Response.Write("<br>" + CHR(13) + CHR(10))
  23. 'Create "LM/W3SVC/MyKey"
  24. Response.Write("Create ""LM/W3SVC/MyKey""<br>" + CHR(13) + CHR(10))
  25. MetaUtil.CreateKey("LM/W3SVC/MyKey")
  26. Response.Write("<br>" + CHR(13) + CHR(10))
  27. 'Enumerate the keys
  28. Response.Write("Enumerate the Keys:<br>" + CHR(13) + CHR(10))
  29. For Each Key In Keys
  30. Response.Write(Key)
  31. Response.Write("<br>" + CHR(13) + CHR(10))
  32. Next
  33. Response.Write("<br>" + CHR(13) + CHR(10))
  34. 'Delete "LM/W3SVC/MyKey"
  35. Response.Write("Delete ""LM/W3SVC/MyKey""<br>" + CHR(13) + CHR(10))
  36. MetaUtil.DeleteKey("LM/W3SVC/MyKey")
  37. Response.Write("<br>" + CHR(13) + CHR(10))
  38. 'Enumerate the keys
  39. Response.Write("Enumerate the Keys:<br>" + CHR(13) + CHR(10))
  40. For Each Key In Keys
  41. Response.Write(Key)
  42. Response.Write("<br>" + CHR(13) + CHR(10))
  43. Next
  44. Response.Write("<br>" + CHR(13) + CHR(10))
  45. Response.Write("Done<br>")
  46. 'Clean up the reference to IIS.MetaUtil
  47. Session.Abandon
  48. %>
  49. </BODY>
  50. </HTML>