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

📄 frmsendfile.frm

📁 网上收集的一个考试管理系统。带论文的
💻 FRM
字号:
VERSION 5.00
Object = "{248DD890-BB45-11CF-9ABC-0080C7E7B78D}#1.0#0"; "MSWINSCK.OCX"
Begin VB.Form FrmThread 
   Caption         =   "SendFileWord"
   ClientHeight    =   555
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   2700
   ControlBox      =   0   'False
   LinkTopic       =   "Form1"
   ScaleHeight     =   555
   ScaleWidth      =   2700
   StartUpPosition =   3  '窗口缺省
   Visible         =   0   'False
   Begin MSWinsockLib.Winsock WskBind 
      Left            =   45
      Top             =   90
      _ExtentX        =   741
      _ExtentY        =   741
      _Version        =   393216
   End
   Begin MSWinsockLib.Winsock WskSendFile 
      Left            =   495
      Top             =   90
      _ExtentX        =   741
      _ExtentY        =   741
      _Version        =   393216
   End
End
Attribute VB_Name = "FrmThread"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private IP As String
Private Port As String
Private FileName As String
Private Wait As Boolean
Private Sub Form_Load()
Dim info() As String
info = Split(Command)
IP = info(0)
Port = info(1)
FileName = info(2)

WskBind.Bind Port, IP
WskBind.Listen

End Sub



Private Sub WskBind_ConnectionRequest(ByVal requestID As Long)
WskSendFile.Close
      WskSendFile.Accept requestID
End Sub



Private Sub WskSendFile_DataArrival(ByVal bytesTotal As Long)
Dim fileBuff() As Byte
Dim FileNumeber
Dim Dstring


      FileNumber = FreeFile
      WskSendFile.GetData Dstring, vbString, bytesTotal

       '---------------------------------------------
  Select Case Mid(Dstring, 1, 10)
         Case "|SendFile|"
             FileNumber = FreeFile
             Open (App.Path & "\" & FileName) For Binary Access Read As #FileNumber
             ReDim fileBuff(LOF(FileNumber)) As Byte
               Get #FileNumber, 1, fileBuff
                WskSendFile.SendData (fileBuff)
             Close #FileNumber
        Case "|DownFile|"
               WskSendFile.Close
               WskBind.Close
               End
 End Select

End Sub

⌨️ 快捷键说明

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