|
|
|
![]() |
|
Strumenti |
![]() |
#1 |
Senior Member
Iscritto dal: Aug 2000
Messaggi: 1209
|
[C#] problema con IHTMLDocument2
Salve,
ho un problema con "IHTMLTxtRange txt = (IHTMLTxtRange)oHTMLDoc.selection.createRange();" lo StreamReader sr mi rimane NULL, se commento il Rigo "IHTMLTxtRange txt = (IHTMLTxtRange)oHTMLDoc.selection.createRange();" funziona!!! oppure funziona pure se decommento il MessageBox sopra allo StreamReader, ma perche ??? Codice:
using mshtml; //-------- private IHTMLDocument2 oHTMLDoc; //-------- oHTMLDoc = (IHTMLDocument2)this.nlrBrowser.Document.DomDocument; oHTMLDoc.designMode = "On"; //MessageBox.Show(""); using (StreamReader sr = new StreamReader(sFilePath)) { string sLine; string sHTML = null; string[] aTotLine = File.ReadAllLines(sFilePath); IHTMLTxtRange txt = (IHTMLTxtRange)oHTMLDoc.selection.createRange(); while ((sLine = sr.ReadLine()) != null) { sHTML += sLine; } txt.pasteHTML(sHTML); } |
![]() |
![]() |
![]() |
Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 11:40.