Class UnsupportedFileFormatException
Navne til: Aspose.Note Sammensætning: Aspose.Note.dll (25.4.0)
Trods under dokumentopladning, når filformatet ikke er genkendt eller ikke understøttet af Aspose.Note.
public class UnsupportedFileFormatException : Exception, ISerializable
Inheritance
object ← Exception ← UnsupportedFileFormatException
Implements
De arvede medlemmer
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
Det viser, hvordan man kontrollerer, om en dokumentladning er mislykkede, fordi OneNote 2007-formatet ikke er understøttet.
// 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(SerializationInfo, StreamingKontext)
Initialiserer en ny instans af Aspose.Note.UnsupportedFileFormatException klasse.
protected UnsupportedFileFormatException(SerializationInfo serializationInfo, StreamingContext synchronizationContext)
Parameters
serializationInfo
SerializationInfo
Det er serialisering info.
synchronizationContext
StreamingContext
Den synkroniserede kontekst.
Properties
FileFormat
Giver filformatet for de data, der er overført, hvis det opdages.
public FileFormat FileFormat { get; }
Ejendomsværdi
Examples
Det viser, hvordan man kontrollerer, om en dokumentladning er mislykkede, fordi OneNote 2007-formatet ikke er understøttet.
// 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;
}