Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cambiar fecha de la pc local
Message
 
To
16/02/2005 08:16:04
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00987188
Message ID:
00987396
Views:
55
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...
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform