Class UnsupportedFileFormatException
Le nom : Aspose.Note Assemblée: Aspose.Note.dll (25.4.0)
Passé pendant le chargement de document, lorsque le format de fichier n’est pas reconnu ou non soutenu par Aspose.Note.
public class UnsupportedFileFormatException : Exception, ISerializable
Inheritance
object ← Exception ← UnsupportedFileFormatException
Implements
I membri ereditari
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
Affiche comment vérifier si un chargement de document échoue parce que le format OneNote 2007 n’est pas supporté.
// 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(Étiquette : StreamingContext)
Initialisez une nouvelle instance de la classe Aspose.Note.UnsupportedFileFormatException.
protected UnsupportedFileFormatException(SerializationInfo serializationInfo, StreamingContext synchronizationContext)
Parameters
serializationInfo
SerializationInfo
Informazioni di serializzazione.
synchronizationContext
StreamingContext
Le contexte de synchronisation.
Properties
FileFormat
Obtenez le format de fichier des données transférées si détectées.
public FileFormat FileFormat { get; }
Valore di proprietà
Examples
Affiche comment vérifier si un chargement de document échoue parce que le format OneNote 2007 n’est pas supporté.
// 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;
}