I got this little "explorer" that allows me to edit the contents of a local html file. I figured out how to use WebBrowser, innerHtml and getelementbyid, from webbrowser to text fields and back to webbrowser when changing a text field. It was pretty easy.
Now I need to save all the changes back to the open and edited html file. I try this:
File.WriteAllText (adresbox1.Text,
webBrowser1.Document.Body.Parent.OuterHtml,
Encoding.GetEncoding(webBrowser1.Document.Encoding));
It works, but html-code output is changed: All id="idlabel"and class="divclass"steel id=idlabeland class=divclass- removal quotations - parser that bypass through these html files, return an error when I change even a single character in the wrong location code. Some styles stop working (the summary of fields and fields in few places is smaller, you can see the changes that update the file that you open in a regular browser):
page-break-after:auto; page-break-inside: avoid;
before the changes they worked! All tags were uppercase ( <head>changed to <head>), many “end of line” deletes removed (several lines of code combined into one) Missing <doctype>and much more.
I am trying an inline method showSaveAsDialog, but of course its not persistent changes.
, . html ( div).
.