Class UnsupportedFileFormatException
A név: Aspose.Note Összefoglaló: Aspose.Note.dll (25.4.0)
A dokumentum feltöltésének ideje alatt, amikor a fájlformátumot nem ismeri fel vagy nem támogatja a Aspose.Note.
public class UnsupportedFileFormatException : Exception, ISerializable
Inheritance
object ← Exception ← UnsupportedFileFormatException
Implements
Örökletes tagok
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
Megmutatja, hogyan kell ellenőrizni, hogy a dokumentum töltés nem sikerül, mert a OneNote 2007 formátum nem támogatott.
// 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(Részletesebben StreamingContext)
Indít egy új példát a Aspose.Note.UnsupportedFileFormatException osztály.
protected UnsupportedFileFormatException(SerializationInfo serializationInfo, StreamingContext synchronizationContext)
Parameters
serializationInfo
SerializationInfo
A serializáció információi.
synchronizationContext
StreamingContext
A szinkronizációs összefüggés.
Properties
FileFormat
Megkapja az átadott adatok fájlformátumát, ha észlelhető.
public FileFormat FileFormat { get; }
ingatlan értéke
Examples
Megmutatja, hogyan kell ellenőrizni, hogy a dokumentum töltés nem sikerül, mert a OneNote 2007 formátum nem támogatott.
// 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;
}