Class UnsupportedFileFormatException

Class UnsupportedFileFormatException

ja nimityö: Aspose.Note Kokoelma: Aspose.Note.dll (25.4.0)

Tiedoston latauksen aikana, kun tiedostomuotoa ei tunneta tai Aspose.Note ei tueta.

public class UnsupportedFileFormatException : Exception, ISerializable

Inheritance

object Exception UnsupportedFileFormatException

Implements

ISerializable

Perintöjäsenet

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

Näytä, miten tarkistaa, että asiakirjan lataus epäonnistuu, koska OneNote 2007 -muotoa ei tueta.

// 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(SerialisaatioInfo, StreamingContext)

Aloitetaan uusi esimerkki Aspose.Note.UnsupportedFileFormatException luokka.

protected UnsupportedFileFormatException(SerializationInfo serializationInfo, StreamingContext synchronizationContext)

Parameters

serializationInfo SerializationInfo

Seriaalisuutta koskevat tiedot.

synchronizationContext StreamingContext

synkronoinnin yhteydessä.

Properties

FileFormat

Saat tiedostomuodossa siirretyt tiedot, jos havaitaan.

public FileFormat FileFormat { get; }

Omistuksen arvo

FileFormat

Examples

Näytä, miten tarkistaa, että asiakirjan lataus epäonnistuu, koska OneNote 2007 -muotoa ei tueta.

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