گرفتن تاریخ روز بطور غیرمستقیم
فرض کنید که کاربر تاریخ سیستم رو عوض کنه و بعد برنامه رو اجرا کنه. راهی وجود داره که بشه تاریخ واقعی روز یا به عبارتی تاریخی که سیستم شروع بکار کرده رو پیدا کرد؟
در ضمن نمیتونم از اینترنت برای گرفتن تاریخ استفاده کنم. تابع Date دلفی و API مربوطه ویندوز هم تاریخی رو که توسط کاربر تعیین شده برمیگردونند.
Re: گرفتن تاریخ روز بطور غیرمستقیم
نقل قول:
نوشته شده توسط DelphiArea
تاریخی که سیستم شروع بکار کرده رو پیدا کرد؟
delphi help ===>win sdk
GetTickCount
GetTickCount
The GetTickCount function retrieves the number of milliseconds that have elapsed since Windows was started.
DWORD GetTickCount(VOID)
Parameters
This function has no parameters.
Return Values
If the function succeeds, the return value is the number of milliseconds that have elapsed since Windows was started.
Remarks
The elapsed time is stored as a DWORD value. Therefore, the time will wrap around to zero if Windows is run continuously for 49.7 days.
Windows NT: To obtain the time elapsed since the computer was started, look up the System Up Time counter in the performance data in the registry key HKEY_PERFORMANCE_DATA . The value returned is an 8 byte value.