Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Start and Stop Services
Message
De
20/07/2015 16:39:05
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows 7
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01622286
Message ID:
01622288
Vues:
70
>How do you go about turning a service OFF in VFP ( by using code ). And.... turn a Service back On ???

It is pretty much the same thing as in .NET. However, you would need to run a DOS command like this:
        ' Enable the task
        loProcessFile.cWorkingDirectory = "c:\Windows\System32"
        loProcessFile.cFileName = "c:\Windows\System32\sc.exe"
        loProcessFile.cArguments = "\\" + lcIP + " start """ + lcService + """"
        If Not loProcessFile.Process() Then
            cMessage = loProcessFile.cMessage
            Return False
        End If
That is .NET code but you can easily adjust as needed.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform