السلام عليكم اعضاء المنتدى الكرام
انا عندي مشكلة في استخدام هذ الكود
Dim theElementCollection As HtmlElementCollection = WebBrowser1.Document.GetElementsByTagName("Input")
For Each curElement As HtmlElement In theElementCollection
Dim controlName As String = curElement.GetAttribute("name").ToString
If controlName = "username" Then
curElement.SetAttribute("Value", TextBox1.Text)
End If
Next
theElementCollection = WebBrowser1.Document.GetElementsByTagName("Input")
For Each curElement As HtmlElement In theElementCollection
Dim controlName As String = curElement.GetAttribute("name").ToString
If controlName = "password" Then
curElement.SetAttribute("Value", TextBox2.Text)
End If
Next
theElementCollection = WebBrowser1.Document.GetElementsByTagName("Input")
For Each curElement As HtmlElement In theElementCollection
If curElement.GetAttribute("name").Equals("") Then
curElement.InvokeMember("click")
End If
Nextعلى هذه الصفحة
<td align="center" valign="bottom" height="175" colspan="2"> <form name="login" action="http://www.hema.com/login" method="post" onSubmit="return doLogin()" > <input type="hidden" name="dst" value="" /> <input type="hidden" name="popup" value="true" /> <table width="100" style="background-color: #ffffff"> <tr><td align="right">login</td> <td><input style="width: 80px" name="username" type="text" value=""/></td> </tr> <tr><td align="right">password</td> <td><input style="width: 80px" name="password" type="password"/></td> </tr> <tr><td> </td> <td><input type="submit" value="OK" /></td> </tr> </table> </form> </td> </tr>
والسبب ان البوتن ليس له ID
<td><input type="submit" value="OK" /></td>
ما العمل الواحد تعب والله