Class UnsupportedFileFormatException
ชื่อพื้นที่: Aspose.Note การประกอบ: Aspose.Note.dll (25.4.0)
ผ่านระหว่างการโหลดเอกสารเมื่อรูปแบบไฟล์ไม่ได้รับการยอมรับหรือไม่ได้รับการสนับสนุนโดย Aspose.Note
public class UnsupportedFileFormatException : Exception, ISerializable
Inheritance
object ← Exception ← UnsupportedFileFormatException
Implements
อนุญาโตตุลาการ
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; }
คุณสมบัติมูลค่า
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;
}