Class UnsupportedFileFormatException
Названий на: Aspose.Note Асамблея: Aspose.Note.dll (25.4.0)
Проходить під час завантаження документів, коли формат файлу не відомий або не підтримується Aspose.Note.
public class UnsupportedFileFormatException : Exception, ISerializable
Inheritance
object ← Exception ← UnsupportedFileFormatException
Implements
Нападні члени
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
Показує, як перевірити, чи не вдається завантажити документ, оскільки формат OneNote 2007 не підтримується.
// 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(Реферат на тему: StreamingContext)
Ініціалює нову інстанцію класу Aspose.Note.UnsupportedFileFormatException.
protected UnsupportedFileFormatException(SerializationInfo serializationInfo, StreamingContext synchronizationContext)
Parameters
serializationInfo
SerializationInfo
Інформація про серіалізацію.
synchronizationContext
StreamingContext
Контекст синхронізації.
Properties
FileFormat
Отримає формат файлу переданих даних, якщо виявлено.
public FileFormat FileFormat { get; }
вартість нерухомості
Examples
Показує, як перевірити, чи не вдається завантажити документ, оскільки формат OneNote 2007 не підтримується.
// 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;
}