home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 5_2007-2008.ISO / data / Zips / Server_Gua2061034182007.psc / ClsService.cls < prev    next >
Text File  |  2005-03-30  |  1KB  |  72 lines

  1. VERSION 1.0 CLASS
  2. BEGIN
  3.   MultiUse = -1  'True
  4.   Persistable = 0  'NotPersistable
  5.   DataBindingBehavior = 0  'vbNone
  6.   DataSourceBehavior  = 0  'vbNone
  7.   MTSTransactionMode  = 0  'NotAnMTSObject
  8. END
  9. Attribute VB_Name = "ClsService"
  10. Attribute VB_GlobalNameSpace = False
  11. Attribute VB_Creatable = True
  12. Attribute VB_PredeclaredId = False
  13. Attribute VB_Exposed = False
  14. Dim svcName As String
  15.  
  16. Enum ServiceStartType
  17.     svcBootStart = &H0
  18.     svcSystemStart = &H1
  19.     svcAutoStart = &H2
  20.     svcDemandStart = &H3
  21.     svcDisabled = &H4
  22. End Enum
  23.  
  24. Public Function StartService() As Boolean
  25.  
  26.     StartService = StartSvc(svcName)
  27.  
  28. End Function
  29.  
  30. Public Function StopService() As Boolean
  31.  
  32.     StopService = StopSvc(svcName)
  33.  
  34. End Function
  35.  
  36. Public Function PauseService() As Boolean
  37.  
  38.     PauseService = PauseSvc(svcName)
  39.  
  40. End Function
  41.  
  42. Public Function ResumeService() As Boolean
  43.  
  44.     ResumeService = ResumeSvc(svcName)
  45.  
  46. End Function
  47.  
  48. Public Function QueryService() As String
  49.  
  50.     QueryService = EnumSvcState(QuerySvc(svcName))
  51.  
  52. End Function
  53.  
  54. Public Property Get ServiceName() As String
  55.  
  56.     ServiceName = svcName
  57.  
  58. End Property
  59.  
  60. Public Property Let ServiceName(ByVal vSvcName As String)
  61.  
  62.     svcName = vSvcName
  63.  
  64. End Property
  65.  
  66. Public Function SetStartType(serviceStart As ServiceStartType) As Boolean
  67.  
  68.     SetStartType = SetSvcStartType(svcName, serviceStart)
  69.  
  70. End Function
  71.  
  72.