Class UnsupportedFileFormatException

UnsupportedFileFormatException class

Wordt gegenereerd tijdens het laden van documenten, wanneer de bestandsindeling niet wordt herkend of niet wordt ondersteund door Aspose.Note.

public class UnsupportedFileFormatException : Exception

Eigenschappen

NaamBeschrijving
FileFormat { get; }Haalt het bestandsformaat op van doorgegeven gegevens indien gedetecteerd.

Voorbeelden

Laat zien hoe u kunt controleren of het laden van een document is mislukt omdat de OneNote 2007-indeling niet wordt ondersteund.

// Het pad naar de documentenmap.
string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
string fileName = Path.Combine(dataDir, "OneNote2007.one");

try
{
    new Document(fileName);
}
catch (UnsupportedFileFormatException e)
{
    if (e.FileFormat == FileFormat.OneNote2007)
    {
        Console.WriteLine("It looks like the provided file is in OneNote 2007 format that is not supported.");
    }
    else
        throw;
}

Zie ook