Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Synchronise Time with Server
Message
De
05/09/2003 13:58:45
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Titre:
Synchronise Time with Server
Divers
Thread ID:
00826554
Message ID:
00826554
Vues:
61
My VFP6 App needs to Synchronise to the time of a server (if one is connected).
The command:
RUN /n NET TIME <servername> /SET /YES 
works fine, but flashes up a DOS window.
So I tried the following - which seems to run, but doesn't actually do the job.
Can anyone help?
DECLARE INTEGER CreateProcess IN kernel32;
  STRING    lpApplicationName,;
  STRING    lpCommandLine,;
  INTEGER @ lpProcessAttributes,;
  INTEGER @ lpThreadAttributes,;
  INTEGER   bInheritHandles,;
  INTEGER   dwCreationFlags,;
  INTEGER @ lpEnvironment,;
  STRING    lpCurrentDirectory,;
  STRING    lpStartupInfo,;
  STRING  @ lpProcessInformation

 lpApplicationName     = "NET" 
 lpCommandLine         = " TIME " + lcServerName + " /SET /YES"
 lpProcessAttributes   = 0      
 lpThreadAttributes    = 0      
 bInheritHandles       = 1      
 dwCreationFlags       = 0
 lpEnvironment         = 0
 lpCurrentDirectory    = "c:\"
 lpStartupInfo         = REPLI (Chr(0), 250)
 lpProcessInformation  = REPLI (" ", 250)

CreateProcess (;
  lpApplicationName,;
  lpCommandLine,;
  @lpProcessAttributes,;
  @lpThreadAttributes,;
  bInheritHandles,;
  dwCreationFlags,;
  @lpEnvironment,;
  lpCurrentDirectory,;
  lpStartupInfo,;
  @lpProcessInformation)
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform