• DR-IT Software
  • Products
  • Documentation
  • Product page
  • Examples
  • API reference
  • Support
Show / Hide Table of Contents

Validate PST

Validates the structure of a PST file.

Code

using DRIT.Mail.Validation;
using DRIT.Mail.Pst.PhysicalLayout;

using var pst = new PstFile("archive.pst");

var validator = new MailValidator();
ValidationResults results = validator.Validate(pst);

if (results.IsValid)
{
    Console.WriteLine("The PST file is valid.");
}
else
{
    Console.WriteLine($"Found {results.Items.Count} issue(s):");
    foreach (string issue in results.Items)
    {
        Console.WriteLine($"  - {issue}");
    }
}

Remarks

MailValidator checks the PST NDB, B-tree, and message-store layers for structural consistency. Issues are reported as human-readable strings in the ValidationResults.Items collection.

  • Improve this Doc
Back to top

DR-IT Software documentation

DR-IT Software · Products · Documentation index · Product page · Downloads · Support · Licensing

Generated by DocFX