Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Cambiar fecha de la pc local
Message
 
À
16/02/2005 08:16:04
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
00987188
Message ID:
00987396
Vues:
54
Modificamos la función para pasarle un segundo parámetro que si es TRUE modifica la hora del PC local cuando ejecutas la función.
? SrvTime("servidor",.T.)

FUNCTION SrvTime( tcSvrName, tlSet )
	LOCAL lcComm, lnHandle, lcString, lcTime

	ERASE srvtime.txt
	lcComm = "Net TIME \\" + tcSvrName + IIF(tlSet," /SET /Y ","") + " > srvtime.txt"
	RUN &lcComm
	IF FILE("srvtime.txt")
		lnHandle = FOPEN("srvtime.txt")
		lcString = FGETS(lnHandle)
		FCLOSE(lnHandle)
		lcTime = SUBSTR(lcString,RATC(SPACE(1),lcString,2)+1)
	ELSE
		lcTime = "?"
	ENDIF

	RETURN lcTime

ENDFUNC
>esto me extrae la fecha del servidor pero ademas de extraer la fecha yo necesito cambiar la hora de la pc local, para que este sincronizado con el servidor, tal ves tenga una diferencia de segundos pero con los segundo no hay problemas.
>
>gracias...
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform