neu
This commit is contained in:
117
AVISO_INFO/frmInfo.vb
Normal file
117
AVISO_INFO/frmInfo.vb
Normal file
@@ -0,0 +1,117 @@
|
||||
Imports CefSharp.WinForms
|
||||
|
||||
Public Class frmInfo
|
||||
|
||||
|
||||
Dim Timer_Sek As Integer = 30
|
||||
Dim Timer_cnt As Integer
|
||||
|
||||
Dim lastLink As String = ""
|
||||
|
||||
|
||||
Dim tmstmp_Eingabe As Date
|
||||
|
||||
Private Sub MyTextBox1_KeyDown(sender As Object, e As KeyEventArgs) Handles MyTextBox1.KeyDown
|
||||
Try
|
||||
|
||||
If e.KeyCode = Keys.Return Then
|
||||
lastLink = MyTextBox1.Text
|
||||
setLink(MyTextBox1.Text)
|
||||
End If
|
||||
|
||||
' Dim c As New ChromiumWebBrowser("as")
|
||||
|
||||
' Me.WebBrowserEx1.ActivateBrowserOnCreation = False
|
||||
|
||||
Catch ex As Exception
|
||||
|
||||
End Try
|
||||
End Sub
|
||||
Sub setLink(link)
|
||||
If validlink(link) Then
|
||||
WebView1.Navigate(link) ', Nothing, Nothing, "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)")
|
||||
' WebBrowserEx1. = MyTextBox1.Text
|
||||
|
||||
MyTextBox1.Text = ""
|
||||
Timer_cnt = Timer_Sek
|
||||
lblClock.Text = Timer_cnt
|
||||
Panel2.Visible = True
|
||||
Timer.Enabled = True
|
||||
btnResetSearch.Visible = True
|
||||
Else
|
||||
reset()
|
||||
End If
|
||||
End Sub
|
||||
'Private Async Sub Button_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
|
||||
' Dim functionString As String = String.Format("document.getElementById('nameDiv').innerText = 'Hello, {0}';", nameTextBox.Text)
|
||||
' Await WebView1.InvokeScriptAsync("eval", New String() {functionString})
|
||||
'End Sub
|
||||
|
||||
|
||||
Private Sub Timer_Tick(sender As Object, e As EventArgs) Handles Timer.Tick
|
||||
Try
|
||||
If Timer_cnt = 0 Then
|
||||
reset()
|
||||
End If
|
||||
|
||||
Timer_cnt -= 1
|
||||
lblClock.Text = Timer_cnt
|
||||
Catch ex As Exception
|
||||
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Sub reset()
|
||||
Timer.Enabled = False
|
||||
Panel2.Visible = False
|
||||
btnResetSearch.Visible = False
|
||||
WebView1.Navigate("")
|
||||
WebView1.Dispose()
|
||||
WebView1 = Nothing
|
||||
MyTextBox1.Text = ""
|
||||
MyTextBox1.Focus()
|
||||
lastLink = ""
|
||||
End Sub
|
||||
|
||||
Private Sub btnResetSearch_Click(sender As Object, e As EventArgs) Handles btnResetSearch.Click
|
||||
Try
|
||||
reset()
|
||||
Catch ex As Exception
|
||||
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
|
||||
MyTextBox1.Focus()
|
||||
End Sub
|
||||
|
||||
Private Sub btn_Click(sender As Object, e As MouseEventArgs) Handles btn.MouseDown, Button1.MouseDown, Button2.MouseDown, Button3.MouseDown, Button4.MouseDown, Button5.MouseDown
|
||||
If validlink(lastLink) Then
|
||||
setLink(lastLink & "&lan=" & sender.tag)
|
||||
End If
|
||||
|
||||
End Sub
|
||||
Function validlink(link) As Boolean
|
||||
If link = "" Then Return False
|
||||
If Not link.contains("https://login.verag.ag/status.aspx?AvisoId=") Then Return False
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Sub timerResetDefault_Tick(sender As Object, e As EventArgs) Handles timerResetDefault.Tick
|
||||
If Timer_cnt > 0 Then Exit Sub ' Anzeige läuft...
|
||||
Dim Result As TimeSpan = Now - tmstmp_Eingabe
|
||||
|
||||
If Result.Seconds > 4 Then
|
||||
reset()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub MyTextBox1_TextChanged(sender As Object, e As EventArgs) Handles MyTextBox1.TextChanged
|
||||
tmstmp_Eingabe = Now
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub btntm_Click(sender As Object, e As MouseEventArgs) Handles pic.MouseDown, lblClock.MouseDown, Panel2.MouseDown
|
||||
Timer_cnt = Timer_Sek + 1 ' zurücksetzen
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user