Class UnsupportedFileFormatException

Class UnsupportedFileFormatException

Nom dels espais: Aspose.Note Assemblea: Aspose.Note.dll (25.4.0)

Passat durant la càrrega de document, quan el format de fitxer no es reconeix o no està recolzat per Aspose.Note.

public class UnsupportedFileFormatException : Exception, ISerializable

Inheritance

object Exception UnsupportedFileFormatException

Implements

ISerializable

Membres heretats

Exception.GetBaseException() , Exception.ToString() , Exception.GetType() , Exception.TargetSite , Exception.Message , Exception.Data , Exception.InnerException , Exception.HelpLink , Exception.Source , Exception.HResult , Exception.StackTrace , Exception.SerializeObjectState , object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()

Examples

Mostra com comprovar si una càrrega de document fracassa perquè el format de OneNote 2007 no està suportat.

// The path to the documents directory.
                                                                                                        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;
                                                                                                        }

Constructors

UnsupportedFileFormatException(Títol: StreamingContext)

Inicia una nova instància de la classe Aspose.Note.UnsuportedFileFormatExcepció.

protected UnsupportedFileFormatException(SerializationInfo serializationInfo, StreamingContext synchronizationContext)

Parameters

serializationInfo SerializationInfo

Informació de la serialitzaci.

synchronizationContext StreamingContext

El context de la sincronització.

Properties

FileFormat

Obté el format de fitxer de les dades transmeses si es detecta.

public FileFormat FileFormat { get; }

Valor de la propietat

FileFormat

Examples

Mostra com comprovar si una càrrega de document fracassa perquè el format de OneNote 2007 no està suportat.

// The path to the documents directory.
                                                                                                        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;
                                                                                                        }
 Català