Class UnsupportedFileFormatException

Class UnsupportedFileFormatException

Název místa: Aspose.Note Shromáždění: Aspose.Note.dll (25.4.0)

V průběhu nabití dokumentu, kdy není formát souboru rozpoznán nebo nepodporován Aspose.Note.

public class UnsupportedFileFormatException : Exception, ISerializable

Inheritance

object Exception UnsupportedFileFormatException

Implements

ISerializable

Dědiční členové

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

Ukazuje, jak zkontrolovat, zda dokumentové zatížení selže, protože formát OneNote 2007 není podporován.

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

Začíná nový příklad třídy Aspose.Note.UnsupportedFileFormatException.

protected UnsupportedFileFormatException(SerializationInfo serializationInfo, StreamingContext synchronizationContext)

Parameters

serializationInfo SerializationInfo

Informace o serializacích.

synchronizationContext StreamingContext

Kontextu synchronizace.

Properties

FileFormat

Obdrží formát souboru předaných údajů, pokud je zjištěn.

public FileFormat FileFormat { get; }

Hodnota nemovitosti

FileFormat

Examples

Ukazuje, jak zkontrolovat, zda dokumentové zatížení selže, protože formát OneNote 2007 není podporován.

// 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;
                                                                                                        }
 Čeština