Class UnsupportedFileFormatException

Class UnsupportedFileFormatException

İsim alanı : Aspose.Note Toplama: Aspose.Note.dll (25.4.0)

Belge yükleme sırasında, dosya biçimi Aspose.Note tarafından tanımlanmadığında veya desteklenmediğinde.

public class UnsupportedFileFormatException : Exception, ISerializable

Inheritance

object Exception UnsupportedFileFormatException

Implements

ISerializable

mirasçı üyeleri

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

Bir belge yükleme başarısız olup olmadığını nasıl kontrol edeceğinizi gösterir, çünkü OneNote 2007 biçimi desteklenmez.

// 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(Etiket Arşivi: StreamingContext)

Aspose.Note.UnsupportedFileFormatException sınıfının yeni bir örneğini başlatır.

protected UnsupportedFileFormatException(SerializationInfo serializationInfo, StreamingContext synchronizationContext)

Parameters

serializationInfo SerializationInfo

Seriyalizasyon Bilgileri

synchronizationContext StreamingContext

Sinkronizasyon konusunu değerlendirin.

Properties

FileFormat

Gönderilen verilerin dosya biçimini alır, tespit edilirse.

public FileFormat FileFormat { get; }

Mülkiyet Değer

FileFormat

Examples

Bir belge yükleme başarısız olup olmadığını nasıl kontrol edeceğinizi gösterir, çünkü OneNote 2007 biçimi desteklenmez.

// 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;
                                                                                                        }
 Türkçe