Class UnsupportedFileFormatException
De naam: Aspose.Note Verzameling: Aspose.Note.dll (25.4.0)
Doorlopen tijdens de documentloading, wanneer het bestandformaat niet wordt herkend of niet ondersteund door Aspose.Note.
public class UnsupportedFileFormatException : Exception, ISerializable
Inheritance
object ← Exception ← UnsupportedFileFormatException
Implements
Geëerbiede leden
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
Toon hoe u kunt controleren of een documentloading faalt omdat het OneNote 2007-formaat niet wordt ondersteund.
// 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(Informatie, StreamingContext)
Initialiseert een nieuwe instantie van de Aspose.Note.UnsupportedFileFormatException klasse.
protected UnsupportedFileFormatException(SerializationInfo serializationInfo, StreamingContext synchronizationContext)
Parameters
serializationInfo
SerializationInfo
Informatie over serialisatie.
synchronizationContext
StreamingContext
De synchronisatie context.
Properties
FileFormat
Het ontvangt het bestandformaat van de doorgeven gegevens als het wordt gedetecteerd.
public FileFormat FileFormat { get; }
Eigendomswaarde
Examples
Toon hoe u kunt controleren of een documentloading faalt omdat het OneNote 2007-formaat niet wordt ondersteund.
// 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;
}