Class UnsupportedFileFormatException
Tên không gian: Aspose.Note Tổng hợp: Aspose.Note.dll (25.4.0)
Thâm nhập trong quá trình tải tài liệu, khi định dạng tệp không được công nhận hoặc không hỗ trợ bởi Aspose.Note.
public class UnsupportedFileFormatException : Exception, ISerializable
Inheritance
object ← Exception ← UnsupportedFileFormatException
Implements
Thành viên thừa kế
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
Hiển thị cách kiểm tra nếu tải tài liệu thất bại vì định dạng OneNote 2007 không được hỗ trợ.
// 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(Thông tin, StreamingContext)
Bắt đầu một trường hợp mới của lớp Aspose.Note.UnsupportedFileFormatException.
protected UnsupportedFileFormatException(SerializationInfo serializationInfo, StreamingContext synchronizationContext)
Parameters
serializationInfo
SerializationInfo
Thông tin serialization
synchronizationContext
StreamingContext
Mối quan hệ đồng bộ hóa
Properties
FileFormat
Nhận định dạng tệp của dữ liệu được thông qua nếu được phát hiện.
public FileFormat FileFormat { get; }
Giá trị bất động sản
Examples
Hiển thị cách kiểm tra nếu tải tài liệu thất bại vì định dạng OneNote 2007 không được hỗ trợ.
// 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;
}