'接收
Private Sub wskS_DataArrival(Index As Integer, ByVal bytesTotal As Long)
'On Error GoTo err1
'接收文件
Static i As Long
Dim inFile() As Byte
Dim myLong As Double
Dim myPath As String
Dim myFree As Long
myPath = VB.App.Path & "\temp\abc.flv"
ReDim inFile(bytesTotal)
wskS(Index).GetData inFile, vbArray + vbByte
myFree = FreeFile
Open myPath For Binary As #myFree '新建文件
Put #myFree, lenth + 1, inFile '将收到的数据写入新文件中
Close #myFree '关闭
'记录文件长度
lenth = lenth + UBound(inFile) - LBound(inFile) + 1
End Sub'发送
Public Function outFiles(filePath As String)
Dim outPath As String
Dim outFileLen As Double
Dim outFileLenN As Double
Dim outFileStar As Double
Dim lngN As Double
Dim outN As Double
Dim outFree As Long
Dim i As Long
'检查是否与服务器连接
outPath = VB.App.Path & "\temp\1.flv" outFileLen = FileLen(outPath)
outN = outFileLen \ 7000 + 1
outFileLenN = outFileLen - (outN - 1) * 7000
objJD.Max = outN
dblJD = 0
objJD.Value = 0
If outFileStar = 0 Then outFileStar = 1
If wskC.State = 7 Then
For i = 0 To outN - 1
If i = outN - 1 Then
outFileStar = i * 7000 + 1
lngN = outFileLen - outFileStar
Else
outFileStar = i * 7000 + 1
lngN = 7000
End If
ReDim outFile(lngN)
outFree = FreeFile
Open outPath For Binary As #outFree
Get #outFree, outFileStar, outFile
Close #outFree
wskC.SendData outFile
DoEvents
objJD.Value = i
DoEvents
Next
End If
End Function
Private Sub wskS_DataArrival(Index As Integer, ByVal bytesTotal As Long)
'On Error GoTo err1
'接收文件
Static i As Long
Dim inFile() As Byte
Dim myLong As Double
Dim myPath As String
Dim myFree As Long
myPath = VB.App.Path & "\temp\abc.flv"
ReDim inFile(bytesTotal)
wskS(Index).GetData inFile, vbArray + vbByte
myFree = FreeFile
Open myPath For Binary As #myFree '新建文件
Put #myFree, lenth + 1, inFile '将收到的数据写入新文件中
Close #myFree '关闭
'记录文件长度
lenth = lenth + UBound(inFile) - LBound(inFile) + 1
End Sub'发送
Public Function outFiles(filePath As String)
Dim outPath As String
Dim outFileLen As Double
Dim outFileLenN As Double
Dim outFileStar As Double
Dim lngN As Double
Dim outN As Double
Dim outFree As Long
Dim i As Long
'检查是否与服务器连接
outPath = VB.App.Path & "\temp\1.flv" outFileLen = FileLen(outPath)
outN = outFileLen \ 7000 + 1
outFileLenN = outFileLen - (outN - 1) * 7000
objJD.Max = outN
dblJD = 0
objJD.Value = 0
If outFileStar = 0 Then outFileStar = 1
If wskC.State = 7 Then
For i = 0 To outN - 1
If i = outN - 1 Then
outFileStar = i * 7000 + 1
lngN = outFileLen - outFileStar
Else
outFileStar = i * 7000 + 1
lngN = 7000
End If
ReDim outFile(lngN)
outFree = FreeFile
Open outPath For Binary As #outFree
Get #outFree, outFileStar, outFile
Close #outFree
wskC.SendData outFile
DoEvents
objJD.Value = i
DoEvents
Next
End If
End Function
解决方案 »
- 生成excel后,某个字段出问题!!急
- listview 中的 itemclick 事件
- 急!用ADO访问Access时,updata出错提示 定义了过多字段 ,怎么解决 ?
- 有人用VB做个触摸屏的系统吗?
- 系统托盘的图标如何闪烁?(在线等,解决就散分!)
- 求采集网页的正则。
- 哪儿有水晶报表Engine 8.0下载?或提供CRPEAUT32.DLL
- 请问如何让toolbar不放置在form的最上边,而是留出一个空间?
- 我的程序有19个窗体,如何用最简单的方法将19个窗体的图标都设置成与主窗体相同的图标,而不是一个一个窗体去设置
- 我很菜,想问关于MDI的问题!
- 图片写入的问题
- 数据报表输出的问题,请教各位高手。
是想把大文件拆开发送
用这段代码做了文件的拆分组合测试
通过
Private Sub Command2_Click()
Dim inPath As String
Dim outPath As String
Dim inFileLen As Double
Dim outFileLen As Double
Dim inFileStar As Double
Dim outFileStar As Double
Dim lngN As Double
Dim outN As Double
Dim inFree As Long
Dim outFree As Long
Dim i As Long
'检查是否与服务器连接
outPath = VB.App.Path & "\temp\1.flv"
inPath = VB.App.Path & "\temp\2.flv"
outFileLen = FileLen(outPath)
outN = outFileLen \ 7000 + 1
For i = 0 To outN - 1
objJD.Max = outN
objJD.Value = i
If i = outN - 1 Then
outFileStar = i * 7000 + 1
lngN = outFileLen - outFileStar
Else
outFileStar = i * 7000 + 1
lngN = 7000
End If
inFileStar = outFileStar
ReDim outFile(lngN)
outFree = FreeFile
Open outPath For Binary As #outFree
Get #outFree, outFileStar, outFile
Close #outFree
ReDim inFile(lngN)
inFree = FreeFile
Open inPath For Binary As #inFree Put #inFree, inFileStar, outFile
Close #inFree
Open inPath For Binary As #inFree
Get #inFree, inFileStar, inFile
Close #inFree
DoEvents
Next
End Sub