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;
                                                                                                        }
 عربي