Ne zaman yüklemek ve Windows tarih bulabilirim?
Bu saçma bir soru biraz gibi gelebilir, ama nasıl (umarım API/kayıt defteri anahtarı ile) Windows saat ve Tarih yükleyebilir miyim?
Şimdiye kadar aklıma gelen en iyi C:\Windows çeşitli dosyalara bak ve tahmin etmeye çalışmaktır. fakat bu iyi bir çözüm değil.
CEVAP
Başka bir soru için elligeable 'code-challenge'işte bu sorunun cevabı için bazı kaynak kodu çalıştırılabilir, ama tam değil.
Herhangi bir bilgisayarı çalıştıracak bir vb script, beklenen sonuç ile bulacaksın ?
systeminfo|find /i "original"
gerçek tarih verecek... saniye sayısı değil ;)
*, Sammy *17 7* *olarak verir ihtiyacınız olandan daha fazla.
Ve bu sadece çalışır eğer yerel İngilizce ise: dil eşleşmesi gerekir.
İsveç için bu "ursprungligt
" ve "ursprüngliches
" Alman için.
Windows PowerShell komut, sadece yazabilirsiniz:
PS > $os = get-wmiobject win32_operatingsystem
PS > $os.ConvertToDateTime($os.InstallDate) -f "MM/dd/yyyy"
WMI (Windows Management Instrumentation) kullanarak
Eğer WMI kullanmak değilse, o zaman kayıt defteri değeri dönüştürmek okumalısınız:
PS > $path = 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion'
PS > $id = get-itemproperty -path $path -name InstallDate
PS > $d = get-date -year 1970 -month 1 -day 1 -hour 0 -minute 0 -second 0
## add to hours (GMT offset)
## to get the timezone offset programatically:
## get-date -f zz
PS > ($d.AddSeconds($id.InstallDate)).ToLocalTime().AddHours((get-date -f zz)) -f "MM/dd/yyyy"
Bu yazının geri kalanını seninle aynı bilgilere erişmek için başka bir yol verir. Zehir;) seç
VB.NET bunun gibi bir şey verir:
Dim dtmInstallDate As DateTime
Dim oSearcher As New ManagementObjectSearcher("SELECT * FROM Win32_OperatingSystem")
For Each oMgmtObj As ManagementObject In oSearcher.Get
dtmInstallDate =
ManagementDateTimeConverter.ToDateTime(CStr(oMgmtO bj("InstallDate")))
Next
Autoit (Windows betik dili), olacaktır:
;Windows Install Date
;
$readreg = RegRead("HKLM\SOFTWARE\MICROSOFT\WINDOWS NT\CURRENTVERSION\", "InstallDate")
$sNewDate = _DateAdd( 's',$readreg, "1970/01/01 00:00:00")
MsgBox( 4096, "", "Date: " & $sNewDate )
Exit
İçinde Delphy gibi gitseydi 7,:
Function GetInstallDate: String;
Var
di: longint;
buf: Array [ 0..3 ] Of byte;
Begin
Result := 'Unknown';
With TRegistry.Create Do
Begin
RootKey := HKEY_LOCAL_MACHINE;
LazyWrite := True;
OpenKey ( '\SOFTWARE\Microsoft\Windows NT\CurrentVersion', False );
di := readbinarydata ( 'InstallDate', buf, sizeof ( buf ) );
// Result := DateTimeToStr ( FileDateToDateTime ( buf [ 0 ] buf [ 1 ] * 256 buf [ 2 ] * 65535 buf [ 3 ] * 16777216 ) );
showMessage(inttostr(di));
Free;
End;
End;
Tarih biçimi ve Windows toplu iş komut...
Nasıl Windows pip yüklemek için?...
Burada JavaScript ile bir tarih biçiml...
Android hata: *yüklemek Başarısız oldu...
Visual Studio her zaman Windows 8 Yöne...