用VB写win7的计算器代码是什么?
答案:2 悬赏:80 手机版
解决时间 2021-11-25 07:41
- 提问者网友:浪荡绅士
- 2021-11-25 02:33
用VB写win7的计算器代码是什么?
最佳答案
- 五星知识达人网友:不如潦草
- 2021-11-25 03:14
Function CRC_CCITT(data() As Byte) As String
Dim CRC16Lo As Byte, CRC16Hi As Byte
Dim CL As Byte, CH As Byte
Dim SaveHi As Byte, SaveLo As Byte
Dim i As Integer
Dim Flag As Integer
CRC16Lo = &HFF
CRC16Hi = &HFF
CL = &H21
CH = &H10
For i = 0 To UBound(data)
CRC16Hi = CRC16Hi Xor data(i)
For Flag = 0 To 7
SaveHi = CRC16Hi
SaveLo = CRC16Lo
If CRC16Hi * 2 > &HFF Then
CRC16Hi = CRC16Hi * 2 - &H100
Else
CRC16Hi = CRC16Hi * 2
End If
If CRC16Lo * 2 > &HFF Then
CRC16Lo = CRC16Lo * 2 - &H100
Else
CRC16Lo = CRC16Lo * 2
End If
If ((SaveLo And &H80) = &H80) Then
CRC16Hi = CRC16Hi Or &H1
End If
If ((SaveHi And &H80) = &H80) Then
CRC16Hi = CRC16Hi Xor CH
CRC16Lo = CRC16Lo Xor CL
End If
Next Flag
Next i
Dim ReturnData(1) As Byte
ReturnData(0) = CRC16Hi
TextBox1.Text = TextBox1.Text & vbCrLf & CStr(CRC16Hi)
ReturnData(1) = CRC16Lo
TextBox1.Text = TextBox1.Text & vbCrLf & CStr(CRC16Lo)
CRC_CCITT = ReturnData
End Function
Dim CRC16Lo As Byte, CRC16Hi As Byte
Dim CL As Byte, CH As Byte
Dim SaveHi As Byte, SaveLo As Byte
Dim i As Integer
Dim Flag As Integer
CRC16Lo = &HFF
CRC16Hi = &HFF
CL = &H21
CH = &H10
For i = 0 To UBound(data)
CRC16Hi = CRC16Hi Xor data(i)
For Flag = 0 To 7
SaveHi = CRC16Hi
SaveLo = CRC16Lo
If CRC16Hi * 2 > &HFF Then
CRC16Hi = CRC16Hi * 2 - &H100
Else
CRC16Hi = CRC16Hi * 2
End If
If CRC16Lo * 2 > &HFF Then
CRC16Lo = CRC16Lo * 2 - &H100
Else
CRC16Lo = CRC16Lo * 2
End If
If ((SaveLo And &H80) = &H80) Then
CRC16Hi = CRC16Hi Or &H1
End If
If ((SaveHi And &H80) = &H80) Then
CRC16Hi = CRC16Hi Xor CH
CRC16Lo = CRC16Lo Xor CL
End If
Next Flag
Next i
Dim ReturnData(1) As Byte
ReturnData(0) = CRC16Hi
TextBox1.Text = TextBox1.Text & vbCrLf & CStr(CRC16Hi)
ReturnData(1) = CRC16Lo
TextBox1.Text = TextBox1.Text & vbCrLf & CStr(CRC16Lo)
CRC_CCITT = ReturnData
End Function
全部回答
- 1楼网友:神鬼未生
- 2021-11-25 04:51
加速器,网上很多源码,百度一下。
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯