다음을 통해 공유


StorageLibraryLastChangeId.Unknown 속성

정의

USN 저널이 오버플로되고 서비스가 변경 내용을 따라갈 수 없거나 변경 ID를 계산할 수 없는 또 다른 이유가 있을 때 반환됩니다.

public:
 static property unsigned long long Unknown { unsigned long long get(); };
static uint64_t Unknown();
public static ulong Unknown { get; }
var uInt64 = StorageLibraryLastChangeId.unknown;
Public Shared ReadOnly Property Unknown As ULong

속성 값

UInt64

unsigned long long

uint64_t

변경 ID를 계산할 수 없음을 나타내는 읽기 전용 고유 식별자입니다.

예제

// applications are expected to persist the previous value
UINT64 appsLastPersistedChangeId = StorageLibraryLastChangeId::Unknown();
StorageFolder folder = StorageFolder::GetFolderFromPathAsync(L"my folder path").get();

StorageLibraryChangeTracker tracker = folder.TryGetChangeTracker();
if (tracker != nullptr)
{
StorageLibraryChangeTrackerOptions ops;
ops.TrackChangeDetails(false);
tracker.Enable(ops);

StorageLibraryChangeReader reader = tracker.GetChangeReader();
if (reader != nullptr)
{
    UINT32 changeId = reader.GetLastChangeId();
    if ((changeId == StorageLibraryLastChangeId::Unknown())
    {
        ScanFolderSlow();
    }
    else if (changeId == 0)
    {
        // no changes in the storage folder yet, OR nothing has changed
        ProcessNormalApplicationStartup();
    }
    else if (changeId != appsLastPersistedChangeId)
    {
        // There have been new changes since we’ve last ran, process them
        appsLastPersistedChangeId = changeId;
        ScanFolderForChanges();
    }
    else
    {
        // changeId and our last persisted change id match, also normal application startup
        ProcessNormalApplicationStartup();
    }
}
}

적용 대상

추가 정보