kytro360
Power Member
- Jan 12, 2010
- 708
- 737
Basically I am trying to click enter on this site for a program I am working on. I asked on another forum and they supplied me with a foreach loop. The thing is the foreach loop keeps looping xD. I even added a break command to it but it still constantly clicks enter.
Can you help me stop it?
p.s: Its located in the Document_Completed event.
Can you help me stop it?
p.s: Its located in the Document_Completed event.
Code:
if (webBrowser1.Url.AbsoluteUri.Contains("http://www.mailinator.com/"))
{
webBrowser1.Document.GetElementById("email").SetAttribute("value", txtMailName.Text);
HtmlElementCollection inputs = webBrowser1.Document.GetElementsByTagName("input");
foreach (HtmlElement input in inputs)
{
if (input.GetAttribute("name") == "email")
input.Focus();
SendKeys.Send("{ENTER}");
break;
}
}