Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Sub SNOW_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SNOW.Tick
- On Error Resume Next
- If BatteryStatus.GetStatus.BatteryLifePercent.ToString.Contains("20") Then
- My.Computer.Audio.Play("C:\Emergency.wav", AudioPlayMode.BackgroundLoop)
- End If
- Dim generator As New Random
- Dim randomValue As Integer
- randomValue = generator.Next(1, 100000)
- Dim URL = "http://forecast.weather.gov/MapClick.php?CityName=Beaverton&state=OR&site=PQR&lat=45.446&lon=-122.882"
- Dim fileExists As Boolean
- fileExists = My.Computer.FileSystem.FileExists("index.html")
- If fileExists Then
- Kill("index.html")
- End If
- My.Computer.Network.DownloadFile(URL, "index.html")
- Dim fileContents As String
- fileContents = My.Computer.FileSystem.ReadAllText("index.html")
- TextBox1.Text = fileContents
- Dim newhtml = TextBox1.Lines(50)
- If newhtml.ToLower.Contains("snow".ToLower) Then
- If slience = 1 Then
- My.Computer.Audio.Stop()
- Else
- Label1.Text = "Yes."
- Label1.ForeColor = Color.Red
- Label1.BackColor = Color.Yellow
- My.Computer.Audio.Play("C:\Emergency.wav", AudioPlayMode.BackgroundLoop)
- End If
- ElseIf newhtml.ToLower.Contains("snow") = False Then
- If slience = 1 Then
- slience = 0
- End If
- Label1.Text = "No."
- Label1.ForeColor = Color.Chartreuse
- Label1.BackColor = Color.Navy
- My.Computer.Audio.Stop()
- End If
- CSS.Navigate(URL)
- On Error Resume Next
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement