c# - Corrupt Metadata after adding to Microsoft Compound File (OLE) -


using openmcdf (c#) loading snt (stickynotes) files this:

private void loadfile(string filename, bool enablecommit)     {         fs = new filestream(             filename,             filemode.open,             enablecommit ?                 fileaccess.readwrite                 : fileaccess.read             );          try         {             if (cf != null)             {                 cf.close();                 cf = null;             }              //load file             if (enablecommit)             {                     cf = new compoundfile(fs, cfsupdatemode.update, cfsconfiguration.sectorrecycle | cfsconfiguration.novalidationexception | cfsconfiguration.erasefreesectors);             }             else             {                 cf = new compoundfile(fs);             }          }         catch (exception ex)         {             messagebox.show("internal error: " + ex.message, "error", messageboxbuttons.ok, messageboxicon.error);         }     } 

now can read, add , remove streams , storages. however, somehow gets saved in "metafile". trying achieve, hiding notes. either deleting them file container, or maybe finding out how windows it. deleting note stikynot application leaves note in snt file somehow hides it. creating new note overwrite old data, deleted note. in meantime, it's hidden.

if remove storage ( note ) file gets corrupted. stickynotes great job @ restoring metadata default, spits out error message. need either repair metadata myself, or let stickynotes "silently". guess there isn't way use stikynot.exe repair metadata?

i dont understand metafile, there header data, references note ids , on. nothing human-readable. here information: (scroll down "the metadata mystery" sticky-notes-kanboard-sync

and here of snt files

  1. a fresh snt file
  2. created 2 notes, 1 isnt deleted yet
  3. created 2 notes, deleted 1 content: deleted note

if open them in editor, can see rtf1 content of notes. in third link, deleted note still in there, gets hidden until new note overwrites content. name of hidden note is:

32f0379-7131-11e7-9 

how hidden? opening files structured storage viewer can view metafile. way of hiding note, or altering without corrupting metafile? or repairing metafile on own? mean openmcdf has many functions. shouldn't possible repair it?


Comments

Popular posts from this blog

html - How to set bootstrap input responsive width? -

javascript - Highchart x and y axes data from json -

javascript - Get js console.log as python variable in QWebView pyqt -