📄 frmmain.frm
字号:
VERSION 5.00
Begin VB.Form frmMain
BorderStyle = 1 'Fixed Single
Caption = "测试服务器端"
ClientHeight = 4815
ClientLeft = 45
ClientTop = 435
ClientWidth = 6750
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4815
ScaleWidth = 6750
StartUpPosition = 1 'CenterOwner
Begin VB.ListBox List1
Height = 3375
Left = 4995
TabIndex = 3
Top = 765
Width = 1590
End
Begin VB.CommandButton cmdShow
Caption = "Show"
Height = 510
Left = 4995
TabIndex = 2
Top = 4185
Width = 1590
End
Begin VB.PictureBox Picture1
Height = 4560
Left = 135
ScaleHeight = 4500
ScaleWidth = 4590
TabIndex = 1
Top = 135
Width = 4650
End
Begin VB.CommandButton cmdWork
Caption = "Start Service"
Height = 465
Left = 4995
TabIndex = 0
Top = 180
Width = 1590
End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'尝试使用WINSOCK控件的自动分包发送机制来做文件传送
'服务器端,控制窗体
'BY 嗷嗷叫的老马
'2008-07-29
Option Explicit
Dim WithEvents WskFrm As frmWsk
Attribute WskFrm.VB_VarHelpID = -1
Dim PicData() As MyType
Private Sub cmdWork_Click()
'启动与停止服务
With cmdWork
If .Tag <> "1" Then
.Tag = "1"
.Caption = "Stop Service"
WskFrm.SetService True
Else
.Tag = "0"
.Caption = "Start Service"
WskFrm.SetService False
End If
End With
End Sub
Private Sub cmdShow_Click()
'把图片数据显示出来
If List1.ListIndex <> -1 Then
If Right(PicData(List1.ListIndex + 1).theSaveName, 4) = ".jpg" Then '判断是不是图片后缀
Set Picture1.Picture = LoadPicture(PicData(List1.ListIndex + 1).theSaveName)
Picture1.Refresh
End If
End If
End Sub
Private Sub Form_Load()
ReDim PicData(0)
Set WskFrm = New frmWsk
End Sub
Private Sub Form_Unload(Cancel As Integer)
Call WskFrm.SetService(False)
Unload WskFrm
Set WskFrm = Nothing
ReDim PicData(0)
End Sub
Private Sub WskFrm_RecvComplet()
ReDim Preserve PicData(UBound(PicData) + 1)
PicData(UBound(PicData)) = PubMyType
Debug.Print UBound(PicData)
List1.AddItem UBound(PicData)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -