Ich versuche, ein Powershell-Skript zu erstellen, um den IE 10/11 Internetverlauf zu lesen, der in AppData \ Local \ Microsoft \ Windows \ WebCache \ gespeichert wird. WebCache.dat.ESENT löst beim Versuch, IE 10/11 WebCache.dat zu öffnen, immer eine EsentPageSizeMismatchException aus
Ich verwende Managed Esent + - Schnittstelle mit dem Win32 Jet API in .NET.
Mein Problem ist, dass ich die Datenbank nie wirklich öffnen kann, da EsentPageSizeMismatchException ausgelöst wird, wenn ich JetAttachDatabase aufrufen. Nach einigen Nachforschungen zu diesem Fehler habe ich festgestellt, dass der IE WebCache eine Seitengröße von 32 KB hat. Als ich versuchte, dies zu korrigieren, startete JetInit die gleiche Ausnahme, indem ich den Systemparameter DatabasePageSize auf 0x8000 einstellte. Hier
ist der Code Ich habe
#stop the things locking the database
stop-process -name taskhost
stop-process -name dllhost
#give powershell access to the interop dlls
add-type -path "$PSScriptRoot\ManagedEsent 1.6\Esent.Interop.dll"
$instance = [Microsoft.Isam.Esent.Interop.JET_INSTANCE]::Nil
#set page size
[Microsoft.Isam.Esent.Interop.api]::JetSetSystemParameter(
$instance,
[Microsoft.Isam.Esent.Interop.JET_SESID]::Nil,
[Microsoft.Isam.Esent.Interop.JET_param]::DatabasePageSize,
0x8000,
$null
)
[Microsoft.Isam.Esent.Interop.Api]::JetCreateInstance([ref]$instance,"testing")
# init the instance, throws EsentPageSizeMismatchException if the page size is not default
[Microsoft.Isam.Esent.Interop.Api]::JetInit([ref]$instance)
$sesid = [Microsoft.Isam.Esent.Interop.JET_SESID]::Nil
[Microsoft.Isam.Esent.Interop.Api]::JetBeginSession($instance,[ref]$sesid,$null,$null)
# throws EsentPageSizeMismatchException if page size is default
[Microsoft.Isam.Esent.Interop.api]::JetAttachDatabase(
$sesid,
"C:\Users\Administrator\AppData\Local\Microsoft\Windows\WebCache\WebCacheV01.dat",
[Microsoft.Isam.Esent.Interop.AttachDatabaseGrbit]::ReadOnly
)
...
Es scheint, wie der ESENT Motor nicht wie die Nicht-Standard-Seitengröße, aber ich habe das Internet durchforstet und es scheint nicht zu sein Möglichkeit, die Seitengröße der Engine zu ändern. Was verursacht diesen Fehler?