G
Gil Schulmann
Hi.
I am trying to load an HTML file into htmlDoc using c#. I see that the
document does not load, but I can not understand where am I wrong. Any
help ?
My Code:
class CFileHandler{
public delegate void
HTMLDocumentEvents2_onreadystatechangeEventHandler(object
sender,EventArgs e)
public void GetXml(FileInfo file){
HTMLDocumentClass doc = new HTMLDocumentClass();
UCOMIPersistFile pf = (UCOMIPersistFile)doc;
pf.Load(file.FullName, 0);
// HTMLDocumentEvents2_Event htmlEvents =
(HTMLDocumentEvents2_Event)doc;
// htmlEvents.onreadystatechange += new
HTMLDocumentEvents2_onreadystatechangeEventHandler();
while( doc.body == null ){
System.Threading.Thread.Sleep(100);
Console.WriteLine(doc.readyState);
}
}
I am using:
using System;
using System.IO;
using System.Collections;
using System.Xml;
using System.Web;
using mshtml;
using System.Runtime.InteropServices;
I am trying to load an HTML file into htmlDoc using c#. I see that the
document does not load, but I can not understand where am I wrong. Any
help ?
My Code:
class CFileHandler{
public delegate void
HTMLDocumentEvents2_onreadystatechangeEventHandler(object
sender,EventArgs e)
public void GetXml(FileInfo file){
HTMLDocumentClass doc = new HTMLDocumentClass();
UCOMIPersistFile pf = (UCOMIPersistFile)doc;
pf.Load(file.FullName, 0);
// HTMLDocumentEvents2_Event htmlEvents =
(HTMLDocumentEvents2_Event)doc;
// htmlEvents.onreadystatechange += new
HTMLDocumentEvents2_onreadystatechangeEventHandler();
while( doc.body == null ){
System.Threading.Thread.Sleep(100);
Console.WriteLine(doc.readyState);
}
}
I am using:
using System;
using System.IO;
using System.Collections;
using System.Xml;
using System.Web;
using mshtml;
using System.Runtime.InteropServices;