fork download
  1. Imports System.Net
  2. Imports System.IO
  3. Public Class Form1
  4.  
  5. Dim wifipassword As String = "http://192.168.254.100:8080/rcmsoftware/wifipass/wifipass.txt"
  6. Dim wifiname As String = "http://192.168.254.100:8080/rcmsoftware/wifipass/wifiname.txt"
  7. Dim updateAddress As String = "http://192.168.254.100:8080/rcmsoftware/wifipass/version.txt"
  8. Dim instance As Net.WebClient = New Net.WebClient
  9. Dim returnValuePass As String
  10. Dim returnValueName As String
  11. Dim returnValueVersion As String
  12. Dim speed As Integer = 1000
  13. Private TargetDT As DateTime
  14. Private CountDownFrom As TimeSpan = TimeSpan.FromMinutes(0.2)
  15.  
  16.  
  17. Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  18.  
  19. If (Process.GetProcessesByName(Process.GetCurrentProcess.ProcessName).Length > 1) Then
  20. MsgBox("Application already running.", MsgBoxStyle.OkOnly, "Error")
  21. Application.Exit()
  22. End If
  23.  
  24. CheckBox1.Enabled = False
  25. Me.MaximizeBox = False
  26. Control.CheckForIllegalCrossThreadCalls = False
  27. BackgroundWorker1.RunWorkerAsync()
  28.  
  29. End Sub
  30.  
  31. Private Sub comparedVersion()
  32.  
  33. animationTimer.Interval = speed
  34. waitTimer.Start()
  35. TargetDT = DateTime.Now.Add(CountDownFrom)
  36. PictureBox3.Visible = True
  37. Label7.Visible = False
  38. PictureBox4.Visible = False
  39. Button1.Enabled = False
  40. Button1.BackColor = Color.WhiteSmoke
  41. PictureBox1.BackColor = Color.RosyBrown
  42. Me.BackgroundWorker1.CancelAsync()
  43.  
  44. End Sub
  45.  
  46. Private Sub preloadForm()
  47.  
  48. Try
  49. returnValueName = instance.DownloadString(wifiname)
  50. returnValuePass = instance.DownloadString(wifipassword)
  51. returnValueVersion = instance.DownloadString(updateAddress)
  52.  
  53. Label9.Text = returnValueName
  54. Label5.Text = returnValueVersion
  55.  
  56. If Label4.Text >= Label5.Text Then
  57. comparedVersion()
  58. Else
  59. CheckForUpdate.Show()
  60. Me.BackgroundWorker1.CancelAsync()
  61. End If
  62.  
  63. Catch ex As Exception
  64.  
  65. Label9.Text = " "
  66. Label7.Visible = True
  67. PictureBox4.Visible = True
  68. Button1.Enabled = True
  69. Button1.BackColor = Color.DarkSeaGreen
  70. PictureBox1.BackColor = Color.WhiteSmoke
  71. CheckBox1.Enabled = False
  72. Me.BackgroundWorker1.CancelAsync()
  73.  
  74. End Try
  75.  
  76. End Sub
  77.  
  78. Private Sub waitTimer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles waitTimer.Tick
  79.  
  80. animationTimer.Start()
  81.  
  82. End Sub
  83.  
  84. Private Sub animationTimer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles animationTimer.Tick
  85.  
  86. Dim ts As TimeSpan = TargetDT.Subtract(DateTime.Now)
  87. TextBox1.Text += returnValuePass.Substring(TextBox1.Text.Length, 1)
  88.  
  89. If TextBox1.Text = returnValuePass Then
  90.  
  91. animationTimer.Stop()
  92. waitTimer.Stop()
  93. Label11.Text = "DONE"
  94. Label11.BackColor = Color.DarkSeaGreen
  95. CheckBox1.Enabled = True
  96. PictureBox2.Visible = True
  97. PictureBox3.Visible = False
  98. PictureBox1.BackColor = Color.DarkSeaGreen
  99.  
  100. ElseIf ts.TotalMilliseconds > 0 Then
  101.  
  102. Label11.Text = ts.ToString("mm\:ss")
  103.  
  104. End If
  105.  
  106. End Sub
  107.  
  108. Private Sub BackgroundWorker1_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork
  109.  
  110. If BackgroundWorker1.CancellationPending = True Then
  111. e.Cancel = True
  112. Else
  113. Label4.Text = Me.ProductVersion
  114. End If
  115.  
  116. End Sub
  117.  
  118. Private Sub BackgroundWorker1_RunWorkerCompleted(ByVal sender As Object, ByVal e As System.ComponentModel.RunWorkerCompletedEventArgs) Handles BackgroundWorker1.RunWorkerCompleted
  119.  
  120. preloadForm()
  121. Me.BackgroundWorker1.CancelAsync()
  122.  
  123. End Sub
  124.  
  125. Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
  126.  
  127. If CheckBox1.Checked Then
  128.  
  129. TextBox1.PasswordChar = vbNullChar
  130.  
  131. Else
  132.  
  133. TextBox1.PasswordChar = "x"
  134.  
  135. End If
  136.  
  137. End Sub
  138.  
  139. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  140.  
  141. preloadForm()
  142.  
  143. End Sub
  144.  
  145. End Class
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Visual Basic.Net Compiler version 0.0.0.5943 (Mono 3.8 - tarball)
Copyright (C) 2004-2010 Rolf Bjarne Kvinge. All rights reserved.

/home/84ze7i/prog.vb (17,102) : error VBNC30590: Cannot find the event 'Load'.
/home/84ze7i/prog.vb (19,20) : error VBNC30451: 'Process' is not declared. It may be inaccessible due to its protection level.
/home/84ze7i/prog.vb (21,25) : error VBNC30451: 'Application' is not declared. It may be inaccessible due to its protection level.
/home/84ze7i/prog.vb (24,19) : error VBNC30451: 'CheckBox1' is not declared. It may be inaccessible due to its protection level.
/home/84ze7i/prog.vb (25,12) : error VBNC30456: 'MaximizeBox' is not a member of 'Form1'.
/home/84ze7i/prog.vb (26,17) : error VBNC30451: 'Control' is not declared. It may be inaccessible due to its protection level.
/home/84ze7i/prog.vb (27,27) : error VBNC30451: 'BackgroundWorker1' is not declared. It may be inaccessible due to its protection level.
/home/84ze7i/prog.vb (33,24) : error VBNC30451: 'animationTimer' is not declared. It may be inaccessible due to its protection level.
/home/84ze7i/prog.vb (34,19) : error VBNC30451: 'waitTimer' is not declared. It may be inaccessible due to its protection level.
/home/84ze7i/prog.vb (36,21) : error VBNC30451: 'PictureBox3' is not declared. It may be inaccessible due to its protection level.
/home/84ze7i/prog.vb (37,16) : error VBNC30451: 'Label7' is not declared. It may be inaccessible due to its protection level.
/home/84ze7i/prog.vb (38,21) : error VBNC30451: 'PictureBox4' is not declared. It may be inaccessible due to its protection level.
/home/84ze7i/prog.vb (39,17) : error VBNC30451: 'Button1' is not declared. It may be inaccessible due to its protection level.
/home/84ze7i/prog.vb (40,17) : error VBNC30451: 'Button1' is not declared. It may be inaccessible due to its protection level.
/home/84ze7i/prog.vb (40,34) : error VBNC30451: 'Color' is not declared. It may be inaccessible due to its protection level.
/home/84ze7i/prog.vb (41,21) : error VBNC30451: 'PictureBox1' is not declared. It may be inaccessible due to its protection level.
/home/84ze7i/prog.vb (41,38) : error VBNC30451: 'Color' is not declared. It may be inaccessible due to its protection level.
/home/84ze7i/prog.vb (42,12) : error VBNC30456: 'BackgroundWorker1' is not a member of 'Form1'.
/home/84ze7i/prog.vb (65,20) : error VBNC30451: 'Label9' is not declared. It may be inaccessible due to its protection level.
/home/84ze7i/prog.vb (66,20) : error VBNC30451: 'Label7' is not declared. It may be inaccessible due to its protection level.
/home/84ze7i/prog.vb (67,25) : error VBNC30451: 'PictureBox4' is not declared. It may be inaccessible due to its protection level.
/home/84ze7i/prog.vb (68,21) : error VBNC30451: 'Button1' is not declared. It may be inaccessible due to its protection level.
/home/84ze7i/prog.vb (69,21) : error VBNC30451: 'Button1' is not declared. It may be inaccessible due to its protection level.
/home/84ze7i/prog.vb (69,38) : error VBNC30451: 'Color' is not declared. It may be inaccessible due to its protection level.
/home/84ze7i/prog.vb (70,25) : error VBNC30451: 'PictureBox1' is not declared. It may be inaccessible due to its protection level.
/home/84ze7i/prog.vb (70,42) : error VBNC30451: 'Color' is not declared. It may be inaccessible due to its protection level.
/home/84ze7i/prog.vb (71,23) : error VBNC30451: 'CheckBox1' is not declared. It may be inaccessible due to its protection level.
/home/84ze7i/prog.vb (72,16) : error VBNC30456: 'BackgroundWorker1' is not a member of 'Form1'.
/home/84ze7i/prog.vb (63,17) : warning VBNC42024: Unused local variable: 'ex'.
/home/84ze7i/prog.vb (53,20) : error VBNC30451: 'Label9' is not declared. It may be inaccessible due to its protection level.
/home/84ze7i/prog.vb (54,20) : error VBNC30451: 'Label5' is not declared. It may be inaccessible due to its protection level.
/home/84ze7i/prog.vb (56,22) : error VBNC30451: 'Label4' is not declared. It may be inaccessible due to its protection level.
/home/84ze7i/prog.vb (56,37) : error VBNC30451: 'Label5' is not declared. It may be inaccessible due to its protection level.
/home/84ze7i/prog.vb (59,32) : error VBNC30451: 'CheckForUpdate' is not declared. It may be inaccessible due to its protection level.
/home/84ze7i/prog.vb (60,20) : error VBNC30456: 'BackgroundWorker1' is not a member of 'Form1'.
/home/84ze7i/prog.vb (78,110) : error VBNC30451: 'waitTimer' is not declared. It may be inaccessible due to its protection level.
/home/84ze7i/prog.vb (80,24) : error VBNC30451: 'animationTimer' is not declared. It may be inaccessible due to its protection level.
/home/84ze7i/prog.vb (84,120) : error VBNC30451: 'animationTimer' is not declared. It may be inaccessible due to its protection level.
/home/84ze7i/prog.vb (87,18) : error VBNC30451: 'TextBox1' is not declared. It may be inaccessible due to its protection level.
/home/84ze7i/prog.vb (87,61) : error VBNC30451: 'TextBox1' is not declared. It may be inaccessible due to its protection level.
/home/84ze7i/prog.vb (89,20) : error VBNC30451: 'TextBox1' is not declared. It may be inaccessible due to its protection level.
/home/84ze7i/prog.vb (91,28) : error VBNC30451: 'animationTimer' is not declared. It may be inaccessible due to its protection level.
/home/84ze7i/prog.vb (92,23) : error VBNC30451: 'waitTimer' is not declared. It may be inaccessible due to its protection level.
/home/84ze7i/prog.vb (93,21) : error VBNC30451: 'Label11' is not declared. It may be inaccessible due to its protection level.
/home/84ze7i/prog.vb (94,21) : error VBNC30451: 'Label11' is not declared. It may be inaccessible due to its protection level.
/home/84ze7i/prog.vb (94,38) : error VBNC30451: 'Color' is not declared. It may be inaccessible due to its protection level.
/home/84ze7i/prog.vb (95,23) : error VBNC30451: 'CheckBox1' is not declared. It may be inaccessible due to its protection level.
/home/84ze7i/prog.vb (96,25) : error VBNC30451: 'PictureBox2' is not declared. It may be inaccessible due to its protection level.
/home/84ze7i/prog.vb (97,25) : error VBNC30451: 'PictureBox3' is not declared. It may be inaccessible due to its protection level.
/home/84ze7i/prog.vb (98,25) : error VBNC30451: 'PictureBox1' is not declared. It may be inaccessible due to its protection level.
/home/84ze7i/prog.vb (98,42) : error VBNC30451: 'Color' is not declared. It may be inaccessible due to its protection level.
/home/84ze7i/prog.vb (102,21) : error VBNC30451: 'Label11' is not declared. It may be inaccessible due to its protection level.
/home/84ze7i/prog.vb (108,149) : error VBNC30451: 'BackgroundWorker1' is not declared. It may be inaccessible due to its protection level.
/home/84ze7i/prog.vb (110,29) : error VBNC30451: 'BackgroundWorker1' is not declared. It may be inaccessible due to its protection level.
/home/84ze7i/prog.vb (113,20) : error VBNC30451: 'Label4' is not declared. It may be inaccessible due to its protection level.
/home/84ze7i/prog.vb (113,30) : error VBNC30456: 'ProductVersion' is not a member of 'Form1'.
/home/84ze7i/prog.vb (118,166) : error VBNC30451: 'BackgroundWorker1' is not declared. It may be inaccessible due to its protection level.
/home/84ze7i/prog.vb (121,12) : error VBNC30456: 'BackgroundWorker1' is not a member of 'Form1'.
/home/84ze7i/prog.vb (125,120) : error VBNC30451: 'CheckBox1' is not declared. It may be inaccessible due to its protection level.
/home/84ze7i/prog.vb (127,21) : error VBNC30451: 'CheckBox1' is not declared. It may be inaccessible due to its protection level.
/home/84ze7i/prog.vb (129,22) : error VBNC30451: 'TextBox1' is not declared. It may be inaccessible due to its protection level.
/home/84ze7i/prog.vb (133,22) : error VBNC30451: 'TextBox1' is not declared. It may be inaccessible due to its protection level.
/home/84ze7i/prog.vb (139,107) : error VBNC30451: 'Button1' is not declared. It may be inaccessible due to its protection level.
There were 62 errors and 1 warnings.
Compilation took 00:00:00.7525320
stdout
Standard output is empty