Class UnsupportedFileFormatException

Class UnsupportedFileFormatException

Il nome: Aspose.Note Assemblea: Aspose.Note.dll (25.4.0)

Trascinato durante il carico di documenti, quando il formato del file non è riconosciuto o non supportato da Aspose.Note.

public class UnsupportedFileFormatException : Exception, ISerializable

Inheritance

object Exception UnsupportedFileFormatException

Implements

ISerializable

I membri ereditari

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 come verificare se un carico di documento fallisce perché il formato OneNote 2007 non è supportato.

// 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(Informazioni su StreamingContext)

Inizia una nuova instanza della classe Aspose.Note.UnsupportedFileFormatException.

protected UnsupportedFileFormatException(SerializationInfo serializationInfo, StreamingContext synchronizationContext)

Parameters

serializationInfo SerializationInfo

Informazioni di serializzazione.

synchronizationContext StreamingContext

Il contesto di sincronizzazione.

Properties

FileFormat

Riceve il formato del file dei dati trasmessi se rilevato.

public FileFormat FileFormat { get; }

Valore di proprietà

FileFormat

Examples

Mostra come verificare se un carico di documento fallisce perché il formato OneNote 2007 non è supportato.

// 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;
                                                                                                        }
 Italiano