Class UnsupportedFileFormatException
Nom dels espais: Aspose.Note Assemblea: Aspose.Note.dll (25.4.0)
Passat durant la càrrega de document, quan el format de fitxer no és reconegut o no recolzat per Aspose.Note.
public class UnsupportedFileFormatException : Exception, ISerializable
{
public UnsupportedFileFormatException() { }
public UnsupportedFileFormatException(string message) : base(message) { }
public UnsupportedFileFormatException(string message, Exception innerException) : base(message, innerException) { }
protected UnsupportedFileFormatException(SerializationInfo info, StreamingContext context) : base(info, context) { }
public string SomeProperty { get; set; }
public void SomeMethod()
{
}
public int SomeOtherMethod(int param1, string param2)
{
}
}
Inheritance
object ← Exception ← UnsupportedFileFormatException
Implements
Membres heretats
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
Mostra com comprovar si una càrrega de document fracassa perquè el format de OneNote 2007 no està suportat.
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
UnsuportedFileFormatExcepció(SerialitzacióInfo, StreamingContext)
Inicia una nova instància de la classe Aspose.Note.UnsupportedFileFormatExcepció.
protected UnsupportedFileFormatException(SerializationInfo serializationInfo, StreamingContext synchronizationContext)
{
base(serializationInfo, synchronizationContext);
}
Parameters
serializationInfo
SerializationInfo
Informació de la serialitzaci.
synchronizationContext
StreamingContext
El context de la sincronització.
Properties
FileFormat
Obté el format de fitxer de les dades transmeses si es detecta.
public FileFormat FileFormat
{
get;
}
Valor de la propietat
Examples
Mostra com comprovar si una càrrega de document fracassa perquè el format de OneNote 2007 no està suportat.
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;
}
}