Class UnsupportedFileFormatException
Nama dari : Aspose.Note Perhitungan: Aspose.Note.dll (25.4.0)
Mengalir selama pengisian dokumen, ketika format file tidak dikenal atau tidak didukung oleh Aspose.Note.
public class UnsupportedFileFormatException : Exception, ISerializable
Inheritance
object ← Exception ← UnsupportedFileFormatException
Implements
anggota yang diwarisi
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
Menunjukkan cara untuk memeriksa apakah pengisian dokumen gagal karena format OneNote 2007 tidak didukung.
// 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(Informasi, StreamingContext)
Initifikasi instansi baru dari Aspose.Note.UnsupportedFileFormatKelas Pengecualian.
protected UnsupportedFileFormatException(SerializationInfo serializationInfo, StreamingContext synchronizationContext)
Parameters
serializationInfo
SerializationInfo
Informasi serialisasi.
synchronizationContext
StreamingContext
dalam konteks sinergitas.
Properties
FileFormat
Dapatkan format file data yang dikirim jika ditemukan.
public FileFormat FileFormat { get; }
Nilai Properti
Examples
Menunjukkan cara untuk memeriksa apakah pengisian dokumen gagal karena format OneNote 2007 tidak didukung.
// 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;
}