Function dectoBin(X As Long) As String
Const Bins = "0000000100100011010001010110011110001001101010111100110111101111"
Dim i As Integer, s As String, y As String
y = Hex(X)
s = ""
For i = 1 To Len(y)
s = s + Mid(Bins, (Val("&h" + Mid(y, i, 1)) * 4 + 1), 4)
Next
dectoBin = Format(s, "0")
End Function
Private Sub Command1_Click()
MsgBox dectoBin(10000)
End Sub
楼上是在别人输入的时候加,看我这个~
第一个问题:
Private Sub Text1_KeyPress(KeyAscii As Integer)
dim I as integer
dim Str as string
for I=1 to len(text1.text)
str=str+mid(text1.text,i,1)+"你要加的符号"
if i=len(text1.text) '去掉最后一个多余的符号
str=mid(str,1,len(str))
end if
next I
End Sub
第二个问题:
用楼上的函数或自己跟据十进制转二进制的算法做个方法.
第三个问题:
思路设置进度条的最大值为传送文件的长度,最小值为零,传送多少就显示多少……