麻烦详细一些,有个说明,我不太懂vb.
解决方案 »
- 如保隐藏comboBox的下拉列表部分.
- tree 左右窗口显示的问题
- VB6求两个窗体可以吸在一起的方法;拖动窗体可以改变位置的方法
- 怎么实现动态加载按钮,并编写响应不同按钮单击的事件代码.
- 关于放midi的问题,请大虾指教
- 水晶报表横排问题
- 某个程序,只能同时开一个,如何用VB使它同时能开2个或多个?
- 程序中将excel文件转换成txt文件后,如何使该txt文件以","分隔
- 下面这几行代码报错,为什么,有替代办法吗?
- 谁知道word窗体上的哪个小东东,是怎么做的?
- CallByName的问题
- 用代码在其它软件上插入菜单,子菜单之后,怎样才能实现在代码生成的菜单或者子菜单上再插入子菜单?又怎样在其中加上方法?
Dim a() As Byte
Open "D:ss.jpg" For Binary As #1
ReDim a(LOF(1) - 1) As Byte
Get #1, , a
Close #1
End Sub
Private Sub Command1_Click()
Dim a() As Byte
Open "D:ss.jpg" For Binary As #1
ReDim a(LOF(1) - 1) As Byte
Get #1, , a
Close #1
Debug.Print xx(a)
End SubPublic Function xx(b() As Byte) As String
Dim i As Integer
For i = 0 To UBound(b)
xx = xx & huan2(CInt(b(i)))
End Function
Public Function huan2(ten As Integer) As String
Dim two As String
Dim n As Double
Do Until ten = 0
n = ten Mod 2
two = n & two
ten = ten \ 2
Loop
huan2 = two
End Function
Open "c\:a.bmp" For Binary As #1
ReDim b(LOF(1) - 1)
Get #1, , b
Close #1
'本函数将文件分割成大小300Byte,并存放到数组arrFile中,lngReturFileNum为返回的分割的块数
Public Function SplitFile(ByVal strSplitFileName As String, ByVal lngSplit As Long, ByRef lngReturFileNum As Long) As Boolean
Dim SaveName As String
Dim fnum As Integer, fnum1 As Integer
SplitFile = True
' On Error GoTo error1
Dim byt1() As Byte
Dim LngNumFile As Long, LngLoop As Long, FilesLen As Long
fnum = FreeFile
Open strSplitFileName For Binary As fnum
'/*精确计算文件将被分割的个数*/
FilesLen = FileLen(strSplitFileName)
If CLng(FilesLen / lngSplit) >= (FilesLen / lngSplit) Or CLng(FilesLen / lngSplit) = (FilesLen / lngSplit) Then
LngNumFile = CLng(FilesLen / lngSplit)
Else
LngNumFile = CLng(FilesLen / lngSplit) + 1
End If
lngReturFileNum = LngNumFile
For LngLoop = 1 To LngNumFile
If LngLoop < LngNumFile Then
ReDim byt1(lngSplit - 1)
ReDim Preserve arrFile(LngLoop - 1)
ReDim Preserve arrFile(LngLoop - 1).byt(lngSplit - 1)
Get #fnum, , byt1
Else
ReDim byt1(FilesLen - ((LngNumFile - 1) * lngSplit) - 1)
ReDim Preserve arrFile(LngLoop - 1)
ReDim Preserve arrFile(LngLoop - 1).byt(FilesLen - ((LngNumFile - 1) * lngSplit) - 1)
Get #fnum, , byt1
Close #fnum
End If
arrFile(UBound(arrFile)).byt = byt1
arrFile(UBound(arrFile)).lngCurrentNum = LngLoop
If LngLoop = 4 Then
Debug.Print ""
End If
Next LngLoop
SplitFile = True
Exit Function
error1:
SplitFile = False
End Function
strSplitFileName 为文件路径;
lngSplit 为分割文件的大小,你页可以不分割;
lngReturFileNum 为返回的分割的个数。