Hi, I created simple application that opens the default browser in a computer. I want to know when the browser is finish
loading the website using C#. Any help would be very much appreciated. Thank you. This is the code.
System.Diagnostics.Process process = new System.Diagnostics.Process();
process.StartInfo.FileName = "www.google.com.ph";
process.Start();
Loading
Kirtan PatelPosted Oct 11, 2009, 4:50 PM
Enjoy ....
and Dont Forget to mark "Do you like this answer" please :) it will give me some credits :)
What Code Does ?
-----------------------
1. Open Website in IE Window
2.When Document Is Completed Loading it Will Show Message Box (" Loading Completed")
Step 1:
Add Reference to SHDocVw.dll From C:\Windows\System32
using SHDocVw;
SHDocVw.InternetExplorer Browser = new InternetExplorerClass();
private void button2_Click(object sender, EventArgs e)
{
IWebBrowserApp wb = (IWebBrowserApp)Browser;
wb.Visible = true;
object o = null;
Browser.Navigate(@"http://yahoo.com",ref o, ref o, ref o, ref o);
}
public void Browser_DocumentComplete(Object o1, ref Object o2)
{
MessageBox.Show("Loading Complete");
}
private void Form1_Load(object sender, EventArgs e)
{
Browser.DocumentComplete += new DWebBrowserEvents2_DocumentCompleteEventHandler(Browser_DocumentComplete);
}
Roei BarPosted Oct 11, 2009, 4:23 PM
TrinityPosted Oct 11, 2009, 4:08 PM