包含vb调用示例
Option Explicit
Private Declare Function MD5String Lib "CommonFunc.dll" (ByVal s As String) As String
Private Declare Function GuidString Lib "CommonFunc.dll" () As String
Private Declare Function Base64Enc Lib "CommonFunc.dll" (ByVal s As String) As String
Private Declare Function Base64Dec Lib "CommonFunc.dll" (ByVal s As String) As String
Private Declare Function CRC_16 Lib "CommonFunc.dll" (ByRef buf As Byte, ByVal nLen As Long) As Long
Private Declare Function DesEncrypt Lib "CommonFunc.dll" (ByVal s As String, ByVal key As String) As String
Private Declare Function DesDecrypt Lib "CommonFunc.dll" (ByVal s As String, ByVal key As String) As String
Private Sub btnCRC16_Click()
Dim FileNumber As Long, lngSize As Long
Dim bytFileContent() As Byte
FileNumber = FreeFile()
Open App.Path & "\工程1.exe" For Binary As #FileNumber
lngSize = LOF(FileNumber)
ReDim bytFileContent(lngSize - 1)
Get #FileNumber, , bytFileContent
Close #FileNumber
Dim lngCRC As Long
lngCRC = CRC_16(bytFileContent(0), lngSize - 1)
Text1.Text = Hex(lngCRC)
End Sub
评论0
最新资源