Class UnsupportedFileFormatException

Class UnsupportedFileFormatException

Namn på plats: Aspose.Note Sammanfattning: Aspose.Note.dll (25.4.0)

Hämta under dokumentladdning, när filformatet inte identifieras eller stöds av 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

ISerializable

Arvsmedlemmar

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

Visa hur man kontrollerar om en dokumentladdning misslyckas eftersom OneNote 2007-format inte stöds.

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, StreamingContext)

Initialiserar en ny instans av Aspose.Note.UnsupportedFileFormatException klass.

protected UnsupportedFileFormatException(SerializationInfo serializationInfo, StreamingContext synchronizationContext)
   {
      base(serializationInfo, synchronizationContext);
   }

Parameters

serializationInfo SerializationInfo

Information om serialiseringen.

synchronizationContext StreamingContext

synkroniseringens sammanhang.

Properties

FileFormat

Få filformat överförda data om det upptäcks.

public FileFormat FileFormat
   {
      get;
   }

Fastighetsvärde

FileFormat

Examples

Visa hur man kontrollerar om en dokumentladdning misslyckas eftersom OneNote 2007-format inte stöds.

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;
      }
   }
 Svenska