⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 serverfiles.frm

📁 用VC++编写的源码
💻 FRM
字号:
VERSION 5.00
Object = "{248DD890-BB45-11CF-9ABC-0080C7E7B78D}#1.0#0"; "MSWINSCK.OCX"
Begin VB.Form Form1 
   Caption         =   "Server"
   ClientHeight    =   3585
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   2700
   LinkTopic       =   "Form1"
   ScaleHeight     =   3585
   ScaleWidth      =   2700
   StartUpPosition =   3  'Windows Default
   Begin MSWinsockLib.Winsock wsTCP 
      Left            =   2040
      Top             =   3120
      _ExtentX        =   741
      _ExtentY        =   741
      _Version        =   393216
   End
   Begin VB.CommandButton cmdRun 
      Caption         =   "Run"
      Height          =   255
      Left            =   840
      TabIndex        =   3
      Top             =   3240
      Width           =   735
   End
   Begin VB.Frame Frame1 
      Caption         =   "Save Files To"
      Height          =   3135
      Left            =   120
      TabIndex        =   0
      Top             =   0
      Width           =   2535
      Begin VB.DirListBox Dir1 
         Height          =   2340
         Left            =   120
         TabIndex        =   2
         Top             =   720
         Width           =   2175
      End
      Begin VB.DriveListBox Drive1 
         Height          =   315
         Left            =   120
         TabIndex        =   1
         Top             =   360
         Width           =   2175
      End
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim lPos As Long

Private Sub cmdRun_Click()
If cmdRun.Caption = "Run" Then
        cmdRun.Caption = "Stop"
        wsTCP.LocalPort = 80
        wsTCP.Listen
    Else
        wsTCP.Close
        cmdRun.Caption = "Run"
    End If
End Sub

Private Sub Dir1_Change()
Dir1.Path = Drive1.Drive
End Sub

Private Sub wsTCP_Close()
Close #1
    'Unload wsTCP(1)
End Sub

Private Sub wsTCP_ConnectionRequest(ByVal requestID As Long)
'Load wsTCP
'    wsTCP.Accept (requestID)
    If Dir(Dir1.Path & "\temp") <> "" Then Kill Dir1.Path & "\temp"
    Open Dir1.Path & "\temp" For Binary As 1
    lPos = 1
End Sub

Private Sub wsTCP_DataArrival(ByVal bytesTotal As Long)
Dim buffer() As Byte
    wsTCP(1).GetData buffer
    Put #1, lPos, buffer
    lPos = lPos + UBound(buffer) + 1
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -