Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Const WEBADRESSE As String = "http://sagegc.sa.funpic.de/ud/info.html"
- Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- HTMLQuelltext = wc.DownloadString(WEBADRESSE)
- Dim Version As String
- Dim Download As String
- Dim vName As String
- Download = Stelle(HTMLQuelltext, "|", "-")
- Version = Stelle(HTMLQuelltext, "<", ">")
- vName = Stelle(HTMLQuelltext, "[", "]")
- pingtest()
- Dim aktuellev As String = "0_0_1" 'Aktuelle Version
- If Version = aktuellev Then
- My.Computer.Network.DownloadFile(Download, vName) '========
- Else
- '#####Überprüfung#####
- 'MsgBox("Fehler...")
- 'If pingtest() = True Then
- 'Dim downloader As New System.Net.WebClient 'ausklammern wen My.Computer
- My.Computer.Network.DownloadFile(Download, vName) ' Früher "downloader.DownloadFile("link", "dasdad.exe")" =====================
- 'End If
- End If
- End Sub
- Function pingtest()
- Dim ping As New Net.NetworkInformation.Ping
- Try
- ping.Send("google.de")
- Return True
- Catch ex As Exception
- Return True
- End Try
- End Function
- Public Function Stelle(ByVal input As String, ByVal Start As String, ByVal Ende As String)
- Dim Reg As New Regex(Start & "(?<value>(.*))" & Ende)
- Return Reg.Match(input).Groups("value").ToString()
- End Function
Advertisement
Add Comment
Please, Sign In to add comment