Private Sub Form_Load()
tcpServer.LocalPort = 1999
tcpServer.Listen
End Sub
Private Sub tcpServer_ConnectionRequest(ByVal requestID As Long)
If tcpServer.State <> sckClosed Then
tcpServer.Close '检查控件的State属性是否为关闭的。
End If '如果不是,在接受新的连接之前先关闭此连接。
tcpServer.Accept requestID
End SubPrivate Sub tcpServer_DataArrival(ByVal bytesTotal As Long)
Dim strData As String
Dim I As Long
Dim mKey As String
tcpServer.GetData strData
'接收数据并存入strData
For I = 1 To Len(strData)
'分离strData中的命令
If Mid(strData, I, 1) = "@" Then
mKey = Left(strData, I - 1)
'把命令ID号存入mKey
'把命令参数存入strData
strData = Right(strData, Len(strData) - I)
Exit For
End If
Next I
Select Case Val(mKey)
Case 1
'驱动器名、目录名、文件名
Case 2
'强制关闭服务器端的计算机
Case 3
'强制重启服务器端的计算机
Case 4
'屏蔽任务栏窗口;
Case 5
'屏蔽开始菜单;
Case 6
'按照客户机端传过来的文件名或目录名,而删除它;
Case 7
'屏蔽热启动键;
Case 8
'运行服务器端的任何程序
End Select
End SubPrivate Sub tcpServer_Close()
tcpServer.Close
tcpServer.Listen
End Sub
tcpServer.LocalPort = 1999
tcpServer.Listen
End Sub
Private Sub tcpServer_ConnectionRequest(ByVal requestID As Long)
If tcpServer.State <> sckClosed Then
tcpServer.Close '检查控件的State属性是否为关闭的。
End If '如果不是,在接受新的连接之前先关闭此连接。
tcpServer.Accept requestID
End SubPrivate Sub tcpServer_DataArrival(ByVal bytesTotal As Long)
Dim strData As String
Dim I As Long
Dim mKey As String
tcpServer.GetData strData
'接收数据并存入strData
For I = 1 To Len(strData)
'分离strData中的命令
If Mid(strData, I, 1) = "@" Then
mKey = Left(strData, I - 1)
'把命令ID号存入mKey
'把命令参数存入strData
strData = Right(strData, Len(strData) - I)
Exit For
End If
Next I
Select Case Val(mKey)
Case 1
'驱动器名、目录名、文件名
Case 2
'强制关闭服务器端的计算机
Case 3
'强制重启服务器端的计算机
Case 4
'屏蔽任务栏窗口;
Case 5
'屏蔽开始菜单;
Case 6
'按照客户机端传过来的文件名或目录名,而删除它;
Case 7
'屏蔽热启动键;
Case 8
'运行服务器端的任何程序
End Select
End SubPrivate Sub tcpServer_Close()
tcpServer.Close
tcpServer.Listen
End Sub
解决方案 »
- 怎样利用API函数拦截网络封包?请高手指点下哦~~~~~~~~~~~~~~~~~~`
- 有关recordset.cancelbatch的用法?
- 如何用程序控制打印机实现双面打印?来者有分,送完为止!
- 请版主把分还我算了
- 请问:用Wise打包重引用了ado2.6 。 安装时要求重启动机器 有办法能不重启动吗?
- 我要用vb播放pc-camera拍摄的时时录象,要怎么做?
- 为何MSHFlexGrid的记录数老是2048?是不是和rs的CursorLocation有关?(在线等待)
- 怎么用commondialog控件返回一个目录(在线等待)
- 求一个VB6.0资源代码
- listview 加入数据
- to zljqf:进来拿分呀!
- 现在在线的朋友进来坐坐
[email protected]