iFile = FreeFile
Open PCDestFile For Binary Access Write As iFile
BytePos = 1
lBufferLen = 2048
Do
lResult = CeReadFile(lCeFileHandle, bytFile(0), _
lBufferLen, lBytesRead, 0&)
If (lResult And (lBytesRead = 0)) Then
lResult = CeCloseHandle(lCeFileHandle)
Close iFile
Exit Do
Else
For I = 0 To lBytesRead - 1
Put iFile, BytePos + I, bytFile(I)
Next I
BytePos = BytePos + lBytesRead
End If
Loop
-------------------------
以上是部分代碼,其中這一句是獲取位元組內容存放到檔案里,我要修改這里,修改方式為把讀取到的內容給一個變數,這個變數做累加器,請問大蝦怎么修改啊?
uj5u.com熱心網友回復:
以上是部分代碼,其中“ Put iFile, BytePos + I, bytFile(I)”這一句是獲取位元組內容存放到檔案里,我要修改這里,修改方式為把讀取到的內容給一個變數,這個變數做累加器,請問大蝦怎么修改啊?-----------------------------
不好意思,補充一下
uj5u.com熱心網友回復:
Dim lSum As Long
...
For I = 0 To lBytesRead - 1
Put iFile, BytePos + I, bytFile(I)
lSum = lSum + bytFile(I)
Next I
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/108062.html
標籤:VB基礎類
上一篇:VB串口通信,發送資料
