Class UnsupportedFileFormatException

UnsupportedFileFormatException class

Wird beim Laden des Dokuments ausgelöst, wenn das Dateiformat nicht erkannt oder von Aspose.Note nicht unterstützt wird.

public class UnsupportedFileFormatException : Exception

Eigenschaften

NameBeschreibung
FileFormat { get; }Ruft das Dateiformat der übergebenen Daten ab, falls erkannt.

Beispiele

Zeigt, wie überprüft wird, ob das Laden eines Dokuments fehlgeschlagen ist, weil das OneNote 2007-Format nicht unterstützt wird.

// Der Pfad zum Dokumentenverzeichnis.
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;
}

Siehe auch