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.

44 lines
1.2 KiB

  1. VERSION 5.00
  2. Begin VB.Form Form1
  3. Caption = "Form1"
  4. ClientHeight = 3195
  5. ClientLeft = 60
  6. ClientTop = 345
  7. ClientWidth = 4680
  8. LinkTopic = "Form1"
  9. ScaleHeight = 3195
  10. ScaleWidth = 4680
  11. StartUpPosition = 3 'Windows Default
  12. End
  13. Attribute VB_Name = "Form1"
  14. Attribute VB_GlobalNameSpace = False
  15. Attribute VB_Creatable = False
  16. Attribute VB_PredeclaredId = True
  17. Attribute VB_Exposed = False
  18. Dim timestamp As New SWbemDateTime
  19. Dim newClass As SWbemObjectEx
  20. Dim newProperty As SWbemProperty
  21. Private Sub Form_Load()
  22. 'Create a new class
  23. Set newClass = GetObject("winmgmts:root\default").Get
  24. 'Set the class name - we could do this via the Path_.Class
  25. 'property but instead we'll use the system property __CLASS
  26. newClass.SystemProperties_("__CLASS").Value = "Archibald"
  27. 'Set the timestamp property
  28. Set newProperty = newClass.SystemProperties_.Add("__TIMESTAMP", wbemCimtypeDatetime)
  29. timestamp.SetVarDate (Now())
  30. newProperty.Value = timestamp.Value
  31. 'Save the object
  32. newClass.Put_
  33. Set newClass = GetObject("winmgmts:root\default:Archibald")
  34. timestamp.Value = newClass.SystemProperties_("__TIMESTAMP").Value
  35. MsgBox timestamp.GetVarDate
  36. End Sub