C
Chuck
I have a bunch of webpages I need to print out.
So I tried doing:
PDataContext dc = new PDataContext();
var q = from a in dc.Reviews.Take(2) select a;
System.Windows.Forms.WebBrowser browser = new
System.Windows.Forms.WebBrowser();
foreach (Review review in q)
{
browser.Navigate( @"http://x.gov/P.aspx?ReviewID=" +
review.ID);
while (browser.ReadyState != WebBrowserReadyState.Complete)
System.Threading.Thread.Sleep(100);
browser.Print();
}
In this scenario the ReadyState never goes to Complete.
I tried adding an eventhandler: Browser_DocumentCompleted
instead of using ReadyState and Sleep and putting the print method in it
but it only fired once.
I'm guessing their is some kind of thread issue where the browser doesn't
try to load until the current method is exited?
Any suggestions,
thanks,
So I tried doing:
PDataContext dc = new PDataContext();
var q = from a in dc.Reviews.Take(2) select a;
System.Windows.Forms.WebBrowser browser = new
System.Windows.Forms.WebBrowser();
foreach (Review review in q)
{
browser.Navigate( @"http://x.gov/P.aspx?ReviewID=" +
review.ID);
while (browser.ReadyState != WebBrowserReadyState.Complete)
System.Threading.Thread.Sleep(100);
browser.Print();
}
In this scenario the ReadyState never goes to Complete.
I tried adding an eventhandler: Browser_DocumentCompleted
instead of using ReadyState and Sleep and putting the print method in it
but it only fired once.
I'm guessing their is some kind of thread issue where the browser doesn't
try to load until the current method is exited?
Any suggestions,
thanks,