
PARA LOS QUE TIENEN AQUALIA
Publicado por neotecnowindows (15 intervenciones) el 10/11/2012 11:06:06
Este es el Código para los que tienen AQUALIA. Más fácil que para Endesa.
-----------------------
-----------------------
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
Public Class Form1
Private contador As Integer
Dim mainstr As String
Dim searchstr As String
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
WebBrowser1.Visible = False
WebBrowser1.Navigate(" https://aqualiaonline.aqualia.es/aqualiaOnline/Default.aspx")
End Sub
Private Sub WebBrowser1_DocumentCompleted(sender As System.Object, e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
Me.Height = 680
Me.Width = 1260
While Not WebBrowser1.ReadyState = WebBrowserReadyState.Complete
Application.DoEvents()
End While
contador = contador + 1
'
On Error Resume Next
If (WebBrowser1.ReadyState = WebBrowserReadyState.Complete) Then
If contador = 1 Then
WebBrowser1.Document.Window.Document.GetElementById("ctl00_ContentPlaceHolderOficinaVirtual_tbCodigoUsuario").SetAttribute("Value", "*******")
WebBrowser1.Document.Window.Document.GetElementById("ctl00_ContentPlaceHolderOficinaVirtual_tbPassword").SetAttribute("Value", "******")
WebBrowser1.Document.Window.Document.GetElementById("ctl00$ContentPlaceHolderOficinaVirtual$btEnviar").InvokeMember("Click")
End If
If contador = 2 Then
mainstr = WebBrowser1.DocumentText
searchstr = "Salir aplicación"
Label1.Visible = False
WebBrowser1.Visible = True
End If
If contador > 2 Then
If mainstr.IndexOf(searchstr) > -1 Then
If WebBrowser1.Document.ActiveElement.TagName = "INPUT" Then
Application.Exit()
End If
End If
End If
End If
End Sub
End Class
Valora esta pregunta


1