Hey
I would like to do the following from a windows application:
1. Open a browser and navigate to a URL.
2. When i am at the correct URL in my browser window, i want to fill in data
in the html textboxes on that page from my windows application.
3. When thats done i want to press a button.
4. last i want to navigate to another URL.
Well, it seems like i did the first issue perfectly (i think), but working
on issue number 2 is killing me. How can i fill in my user input
automatically to my web browser from my windows application?
Ok, heres what i got so far:
SHDocVw.ShellWindows SWs = new SHDocVw.ShellWindows();
SHDocVw.InternetExplorer IExplorer = new
SHDocVw.InternetExplorer();
IExplorer.Visible = true;
IExplorer.Navigate(http://MyURL.asp, ref o, ref o, ref o, ref
o);
int counter = SWs.Count;
foreach (SHDocVw.InternetExplorer ie in SWs)
{
if (ie.LocationURL.ToString() == http://MyURL/SubPage.asp)
{
IHTMLDocument2 document = (IHTMLDocument2)ie.Document;
MessageBox.Show(document.all.tags("navn").ToString ());
//Gives me System.__ComObject???
//So far so good
//The following is simply just not working. Maybe im doing it all wrong??
HTMLTextElement navn =
(HTMLTextElement)document.all.tags("navn");
navn.innerText = "HEJ";
}
}
Anyone?
--
Jimmy