저는 포럼을위한 로그인 시스템을 개발 중이고 C# .net 형식으로 작동하도록하고 있습니다. 프로그래밍 방식으로 webBrower 컨트롤을 사용하여 포럼의 로그인 버튼을 클릭해야합니다. 지금까지 나는 이것을 가지고있다.webBrower Button 요소 ID가없는 클릭?
webPage page = new webPage();
page.URL = txtURL.Text;
page.Load(); //Load the text from the specified URL
WebBrowser browser = new WebBrowser();
browser.Document.GetElementById("navbar_username").SetAttribute("value", textBox1.Text);
browser.Document.GetElementById("navbar_password").SetAttribute("value", textBox2.Text);
HtmlElement el = browser.Document.All["btnI"];
if (el != null)
{
el.InvokeMember("click");
}
else
{
MessageBox.Show("There is an issue with the program");
}
문제는 페이지의 로그인 버튼이 ID 또는 내가 그것을 클릭 할 수 있도록 할 수있는 모든 실제 정보가없는 것입니다. 누구든지 어떤 제안이 있습니까? 다음은 로그인 버튼의 코드입니다.
<input type="image" src="images/loginbutton.png" class="loginbutton" tabindex="104" value="Log in" title="Enter your username and password in the boxes provided to login, or click the 'register' button to create a profile for yourself." accesskey="s">
왜 downvote입니까? 키스. – ncases
예, 3 명이 있습니다. – Jeremy