Class UnsupportedFileFormatException

Class UnsupportedFileFormatException

Το όνομα: Aspose.Note Συγκέντρωση: Aspose.Note.dll (25.4.0)

Διαρροή κατά τη διάρκεια της φόρτωσης εγγράφου, όταν η μορφή αρχείου δεν αναγνωρίζεται ή δεν υποστηρίζεται από το Aspose.Note.

public class UnsupportedFileFormatException : Exception, ISerializable

Inheritance

object Exception UnsupportedFileFormatException

Implements

ISerializable

Κληρονομημένα μέλη

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

Δείχνει πώς να ελέγξετε αν ένα φορτίο εγγράφου αποτύχει επειδή η μορφή του OneNote 2007 δεν υποστηρίζεται.

// 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(Ενημέρωση, StreamingContext)

Αρχίζει μια νέα περίπτωση της κατηγορίας Aspose.Note.UnsupportedFileFormatException.

protected UnsupportedFileFormatException(SerializationInfo serializationInfo, StreamingContext synchronizationContext)

Parameters

serializationInfo SerializationInfo

Η πληροφορία της σειράς.

synchronizationContext StreamingContext

Το πλαίσιο της συγχρονισμού.

Properties

FileFormat

Αποκτά τη μορφή αρχείου των δεδομένων που διαβιβάζονται, εάν ανιχνεύονται.

public FileFormat FileFormat { get; }

Αξία ιδιοκτησίας

FileFormat

Examples

Δείχνει πώς να ελέγξετε αν ένα φορτίο εγγράφου αποτύχει επειδή η μορφή του OneNote 2007 δεν υποστηρίζεται.

// 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;
                                                                                                        }
 Ελληνικά