GetCreationTime() публичный Метод

public GetCreationTime ( string path ) : DateTimeOffset
path string
Результат DateTimeOffset
Пример #1
0
        private static void CleanupLogs(IsolatedStorageFile store, string logFolder)
        {
            var files = store.GetFileNames(logFolder);
            var fileCount = files.Count();
            if (fileCount > MAX_FILE_COUNT - 1)
            {
                var filesAgeAsc = from file in files
                                  let age = store.GetCreationTime(file)
                                  orderby age ascending
                                  select file;
                var deleteFiles = filesAgeAsc.Take(fileCount - MAX_FILE_COUNT + 1);

                foreach (var file in deleteFiles)
                {
                    var filePath = Path.Combine(logFolder, file);
                    store.DeleteFile(filePath);
                }
            }
        }