Class UnsupportedFileFormatException

UnsupportedFileFormatException class

Se genera durante la carga del documento, cuando Aspose.Note no reconoce o no admite el formato de archivo.

public class UnsupportedFileFormatException : Exception

Propiedades

NombreDescripción
FileFormat { get; }Obtiene el formato de archivo de los datos pasados si se detecta.

Ejemplos

Muestra cómo verificar si la carga de un documento falla porque el formato de OneNote 2007 no es compatible.

// La ruta al directorio de documentos.
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;
}

Ver también