分要多少我全给也行!
解决方案 »
- listview 行背景色问题
- vb toolbar TbrDropDown式样按钮如何点击按钮也弹出下级菜单
- 二进制文件中特征16进制编码的查找和比较(注意,中间有00的字符)
- vb在调用access中的问题,谢谢大家
- 關於listbox的問題
- 寻一个会vb的好心人,,跪求,,急求,,会做(简单画面的模拟试验)
- 编程的困惑!请您告诉我???????????????????????
- 想问一下Shell的用法!!
- 请问各位大侠用VB编的控件或着ActiveX.exe在Delphi中怎么安装或调用
- 各位高手,请问怎么拦截到在window浏览器中双击文件夹的事件?????
- 急!急!关于单片机同PC机串口通信的问题!!SOS!请求大家帮忙!
- 请问各位高手,如何在ocx控件中初始化如何解决
'This is where we send the file data
Dim ChunkSize As Long
Dim Chunk() As Byte
Dim arrHash() As Byte
If wsSend.State <> sckConnected Then Exit Function
ChunkSize = FT_BUFFER_SIZE '自己定
If FileNum = 0 Then 'No data has been sent yet, open the file
FileNum = FreeFile
Open filename For Binary As #FileNum
End If
'determine chunk size
If (LOF(FileNum) - Loc(FileNum)) < FT_BUFFER_SIZE Then _
ChunkSize = (LOF(FileNum) - Loc(FileNum))
'set array size to fit chunk
ReDim Chunk(0 To ChunkSize - 1)
'read the chunk
Get #FileNum, , Chunk
'Send the data
wsSend.SendData Chunk
Sentbyt = Sentbyt + ChunkSize
ByteSec = ByteSec + ChunkSize
'See if file is sent
If Sentbyt = FileSize Then 'FileSize自己先找好
Complete = True
Close #FileNum
End If
End Function
接收端:Open Filename For Binary As #FileNumDim GotDat() As Byte
Dim Hash As String
ByteSec = ByteSec + bytesTotal
Receivedbyt = Receivedbyt + bytesTotalReDim GotDat(0 To bytesTotal - 1)
wsReceive.GetData GotDat, vbArray + vbByte
Put #FileNum, , GotDat
If Receivedbyt = FileSize Then
Close #FileNum
Complete = True
End If
不明白就来mail, [email protected]