Form8.vb 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. Imports System.IO
  2. Imports System.IO.Compression
  3. Public Class Form8
  4. Dim appPath As String = Application.StartupPath()
  5. Private IsFormBeingDragged As Boolean = False
  6. Private MouseDownX As Integer
  7. Private MouseDownY As Integer
  8. Dim z As String
  9. Private Sub Form8_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
  10. For counter = 10 To 90 Step +20
  11. Me.Opacity = counter / 100
  12. Me.Refresh()
  13. Threading.Thread.Sleep(50)
  14. Next
  15. Me.Opacity = 100
  16. End Sub
  17. Private Sub Form8_MouseDown(ByVal sender As Object, ByVal e As MouseEventArgs) Handles MyBase.MouseDown
  18. If e.Button = MouseButtons.Left Then
  19. IsFormBeingDragged = True
  20. MouseDownX = e.X
  21. MouseDownY = e.Y
  22. End If
  23. End Sub
  24. Private Sub Form8_MouseUp(ByVal sender As Object, ByVal e As MouseEventArgs) Handles MyBase.MouseUp
  25. If e.Button = MouseButtons.Left Then
  26. IsFormBeingDragged = False
  27. End If
  28. End Sub
  29. Private Sub Form8_MouseMove(ByVal sender As Object, ByVal e As MouseEventArgs) Handles MyBase.MouseMove
  30. If IsFormBeingDragged Then
  31. Dim temp As Point = New Point()
  32. temp.X = Me.Location.X + (e.X - MouseDownX)
  33. temp.Y = Me.Location.Y + (e.Y - MouseDownY)
  34. Me.Location = temp
  35. temp = Nothing
  36. End If
  37. End Sub
  38. Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
  39. Dim iCount As Integer
  40. For iCount = 90 To 10 Step -10
  41. Me.Opacity = iCount / 100
  42. Threading.Thread.Sleep(50)
  43. Next
  44. Me.Close()
  45. End Sub
  46. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  47. 'Will hold all of the text
  48. Dim Output As String
  49. 'Create a new process object
  50. Using P As New Process()
  51. 'Set the script to run the standard command shell
  52. P.StartInfo.FileName = "cmd.exe"
  53. 'Required to redirect output, don't both worrying what it means
  54. P.StartInfo.UseShellExecute = False
  55. 'Tell the system that you want to read/write to it
  56. P.StartInfo.RedirectStandardOutput = True
  57. P.StartInfo.RedirectStandardInput = True
  58. 'Start your batch
  59. P.Start()
  60. 'Send your various commands
  61. P.StandardInput.WriteLine("ipconfig /all")
  62. 'Very important, send the "exit" command otherwise STDOUT will never close the stream
  63. P.StandardInput.WriteLine("exit")
  64. 'Read the entire stream
  65. Output = P.StandardOutput.ReadToEnd()
  66. 'Wait until the batch is done running
  67. P.WaitForExit()
  68. End Using
  69. 'Do something with the output
  70. Trace.WriteLine(Output)
  71. TextBox1.Text = Output
  72. End Sub
  73. End Class