VB6四字节卡号相互转换源码

2023-10-10 00:50

本文主要是介绍VB6四字节卡号相互转换源码,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

读卡器介绍:ID IC ICode 2 HID ICLASS 二代证RFID读卡器USB模拟键盘输出卡号-淘宝网 (taobao.com)

Private Sub Command1_Click()
Dim H2b As Double
Dim L2b As Double
Dim i As Integer
Dim HexStr, wg34 As StringDim lsh
Dim mypiccdata(4) As Bytelsh = Val(Text1)
If lsh > 4294967295# ThenMsgBox "数据大于4字节会溢出!请重新输入", vbCritical + vbOKOnly, "提示"Text1.SetFocusExit Sub
End IfH2b = Int(lsh / (65536))
L2b = lsh - H2b * 65536HexStr = Right("0000" + Hex(H2b), 4) + Right("0000" + Hex(L2b), 4)
Text4 = HexStrFor i = 0 To 3mypiccdata(i) = "&H" + Mid(HexStr, i * 2 + 1, 2)Text2(i) = mypiccdata(i)Text3(i) = Right("00" + Hex(mypiccdata(i)), 2)
Nextdoublecardhao = mypiccdata(1)
doublecardhao = doublecardhao * 256
doublecardhao = doublecardhao + mypiccdata(2)
doublecardhao = doublecardhao * 256
doublecardhao = doublecardhao + mypiccdata(3)
Text5 = Format(doublecardhao, "00000000")doublecardhao = mypiccdata(2)
doublecardhao = doublecardhao * 256
doublecardhao = doublecardhao + mypiccdata(3)
Text6 = Format(mypiccdata(1), "000") + Format(doublecardhao, "00000")doublecardhao = mypiccdata(0)
doublecardhao = doublecardhao * 256
doublecardhao = doublecardhao + mypiccdata(1)
wg34 = Format(doublecardhao, "00000")
doublecardhao = mypiccdata(2)
doublecardhao = doublecardhao * 256
doublecardhao = doublecardhao + mypiccdata(3)
Text7 = wg34 + Format(doublecardhao, "00000")End SubPrivate Sub Command2_Click()
Dim i As Integer
Dim HexStr As String
Dim mypiccdata(4) As Byte
Dim doublecardhao As DoubleHexStr = Right("00000000" + Trim(Text4), 8)
Text4 = HexStrFor i = 0 To 3Text3(i) = Mid(HexStr, i * 2 + 1, 2)mypiccdata(i) = "&H" + Mid(HexStr, i * 2 + 1, 2)Text2(i) = mypiccdata(i)
Nextdoublecardhao = mypiccdata(0)
doublecardhao = doublecardhao * 256
doublecardhao = doublecardhao + mypiccdata(1)
doublecardhao = doublecardhao * 256
doublecardhao = doublecardhao + mypiccdata(2)
doublecardhao = doublecardhao * 256
doublecardhao = doublecardhao + mypiccdata(3)
Text1 = Format(doublecardhao, "0000000000")doublecardhao = mypiccdata(1)
doublecardhao = doublecardhao * 256
doublecardhao = doublecardhao + mypiccdata(2)
doublecardhao = doublecardhao * 256
doublecardhao = doublecardhao + mypiccdata(3)
Text5 = Format(doublecardhao, "00000000")doublecardhao = mypiccdata(2)
doublecardhao = doublecardhao * 256
doublecardhao = doublecardhao + mypiccdata(3)
Text6 = Format(mypiccdata(1), "000") + Format(doublecardhao, "00000")doublecardhao = mypiccdata(0)
doublecardhao = doublecardhao * 256
doublecardhao = doublecardhao + mypiccdata(1)
wg34 = Format(doublecardhao, "00000")
doublecardhao = mypiccdata(2)
doublecardhao = doublecardhao * 256
doublecardhao = doublecardhao + mypiccdata(3)
Text7 = wg34 + Format(doublecardhao, "00000")End SubPrivate Sub Command3_Click()
Dim i As Integer
Dim HexStr As String
Dim mypiccdata(4) As Byte
Dim doublecardhao As DoubleFor i = 0 To 3If Text2(i) = "" ThenMsgBox "请输入正确的十进制数据!", vbCritical + vbOKOnly, "提示"Text2(i).SetFocusExit SubEnd If
NextHexStr = ""
For i = 0 To 3mypiccdata(i) = Val(Text2(i))Text3(i) = Right("00" + Hex(Val(Text2(i))), 2)HexStr = HexStr + Right("00" + Hex(Val(Text2(i))), 2)
Next
Text4 = HexStrdoublecardhao = mypiccdata(0)
doublecardhao = doublecardhao * 256
doublecardhao = doublecardhao + mypiccdata(1)
doublecardhao = doublecardhao * 256
doublecardhao = doublecardhao + mypiccdata(2)
doublecardhao = doublecardhao * 256
doublecardhao = doublecardhao + mypiccdata(3)
Text1 = Format(doublecardhao, "0000000000")doublecardhao = mypiccdata(1)
doublecardhao = doublecardhao * 256
doublecardhao = doublecardhao + mypiccdata(2)
doublecardhao = doublecardhao * 256
doublecardhao = doublecardhao + mypiccdata(3)
Text5 = Format(doublecardhao, "00000000")doublecardhao = mypiccdata(2)
doublecardhao = doublecardhao * 256
doublecardhao = doublecardhao + mypiccdata(3)
Text6 = Format(mypiccdata(1), "000") + Format(doublecardhao, "00000")doublecardhao = mypiccdata(0)
doublecardhao = doublecardhao * 256
doublecardhao = doublecardhao + mypiccdata(1)
wg34 = Format(doublecardhao, "00000")
doublecardhao = mypiccdata(2)
doublecardhao = doublecardhao * 256
doublecardhao = doublecardhao + mypiccdata(3)
Text7 = wg34 + Format(doublecardhao, "00000")
End SubPrivate Sub Command4_Click()
Dim i As Integer
Dim HexStr As String
Dim mypiccdata(4) As Byte
Dim doublecardhao As DoubleFor i = 0 To 3If Text3(i) = "" ThenMsgBox "请输入正确的十六进制数据!", vbCritical + vbOKOnly, "提示"Text3(i).SetFocusExit SubEnd If
NextHexStr = ""
For i = 0 To 3mypiccdata(i) = "&H" + Trim(Text3(i))Text2(i) = mypiccdata(i)HexStr = HexStr + Right("00" + Trim(Text3(i)), 2)
Next
Text4 = HexStrdoublecardhao = mypiccdata(0)
doublecardhao = doublecardhao * 256
doublecardhao = doublecardhao + mypiccdata(1)
doublecardhao = doublecardhao * 256
doublecardhao = doublecardhao + mypiccdata(2)
doublecardhao = doublecardhao * 256
doublecardhao = doublecardhao + mypiccdata(3)
Text1 = Format(doublecardhao, "0000000000")doublecardhao = mypiccdata(1)
doublecardhao = doublecardhao * 256
doublecardhao = doublecardhao + mypiccdata(2)
doublecardhao = doublecardhao * 256
doublecardhao = doublecardhao + mypiccdata(3)
Text5 = Format(doublecardhao, "00000000")doublecardhao = mypiccdata(2)
doublecardhao = doublecardhao * 256
doublecardhao = doublecardhao + mypiccdata(3)
Text6 = Format(mypiccdata(1), "000") + Format(doublecardhao, "00000")doublecardhao = mypiccdata(0)
doublecardhao = doublecardhao * 256
doublecardhao = doublecardhao + mypiccdata(1)
wg34 = Format(doublecardhao, "00000")
doublecardhao = mypiccdata(2)
doublecardhao = doublecardhao * 256
doublecardhao = doublecardhao + mypiccdata(3)
Text7 = wg34 + Format(doublecardhao, "00000")
End SubPrivate Sub Text1_KeyPress(KeyAscii As Integer)Select Case KeyAsciiCase 13Command1_ClickCase vbKey0 To vbKey9, vbKeyBackCase ElseKeyAscii = 0End Select
End Sub
Private Sub Text2_KeyPress(Index As Integer, KeyAscii As Integer)Select Case KeyAsciiCase vbKey0 To vbKey9, vbKeyBackCase ElseKeyAscii = 0End Select
End SubPrivate Sub Text2_LostFocus(Index As Integer)
If Text2(Index) > 255 ThenMsgBox "请输入0-255之间的数!", vbCritical + vbOKOnly, "提示"Text2(Index) = 0Text2(Index).SetFocus
End If
End SubPrivate Sub Text3_KeyPress(Index As Integer, KeyAscii As Integer)
Select Case KeyAsciiCase vbKey0 To vbKey9, vbKeyBackCase 97 To 102Case 65 To 70Case ElseKeyAscii = 0End Select
End SubPrivate Sub Text4_KeyPress(KeyAscii As Integer)
Select Case KeyAsciiCase 13Command3_ClickCase vbKey0 To vbKey9, vbKeyBackCase 97 To 102Case 65 To 70Case ElseKeyAscii = 0End Select
End Sub

这篇关于VB6四字节卡号相互转换源码的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/176771

相关文章

字节面试 | 如何测试RocketMQ、RocketMQ?

字节面试:RocketMQ是怎么测试的呢? 答: 首先保证消息的消费正确、设计逆向用例,在验证消息内容为空等情况时的消费正确性; 推送大批量MQ,通过Admin控制台查看MQ消费的情况,是否出现消费假死、TPS是否正常等等问题。(上述都是临场发挥,但是RocketMQ真正的测试点,还真的需要探讨) 01 先了解RocketMQ 作为测试也是要简单了解RocketMQ。简单来说,就是一个分

JAVA智听未来一站式有声阅读平台听书系统小程序源码

智听未来,一站式有声阅读平台听书系统 🌟 开篇:遇见未来,从“智听”开始 在这个快节奏的时代,你是否渴望在忙碌的间隙,找到一片属于自己的宁静角落?是否梦想着能随时随地,沉浸在知识的海洋,或是故事的奇幻世界里?今天,就让我带你一起探索“智听未来”——这一站式有声阅读平台听书系统,它正悄悄改变着我们的阅读方式,让未来触手可及! 📚 第一站:海量资源,应有尽有 走进“智听

Java ArrayList扩容机制 (源码解读)

结论:初始长度为10,若所需长度小于1.5倍原长度,则按照1.5倍扩容。若不够用则按照所需长度扩容。 一. 明确类内部重要变量含义         1:数组默认长度         2:这是一个共享的空数组实例,用于明确创建长度为0时的ArrayList ,比如通过 new ArrayList<>(0),ArrayList 内部的数组 elementData 会指向这个 EMPTY_EL

如何在Visual Studio中调试.NET源码

今天偶然在看别人代码时,发现在他的代码里使用了Any判断List<T>是否为空。 我一般的做法是先判断是否为null,再判断Count。 看了一下Count的源码如下: 1 [__DynamicallyInvokable]2 public int Count3 {4 [__DynamicallyInvokable]5 get

工厂ERP管理系统实现源码(JAVA)

工厂进销存管理系统是一个集采购管理、仓库管理、生产管理和销售管理于一体的综合解决方案。该系统旨在帮助企业优化流程、提高效率、降低成本,并实时掌握各环节的运营状况。 在采购管理方面,系统能够处理采购订单、供应商管理和采购入库等流程,确保采购过程的透明和高效。仓库管理方面,实现库存的精准管理,包括入库、出库、盘点等操作,确保库存数据的准确性和实时性。 生产管理模块则涵盖了生产计划制定、物料需求计划、

Spring 源码解读:自定义实现Bean定义的注册与解析

引言 在Spring框架中,Bean的注册与解析是整个依赖注入流程的核心步骤。通过Bean定义,Spring容器知道如何创建、配置和管理每个Bean实例。本篇文章将通过实现一个简化版的Bean定义注册与解析机制,帮助你理解Spring框架背后的设计逻辑。我们还将对比Spring中的BeanDefinition和BeanDefinitionRegistry,以全面掌握Bean注册和解析的核心原理。

音视频入门基础:WAV专题(10)——FFmpeg源码中计算WAV音频文件每个packet的pts、dts的实现

一、引言 从文章《音视频入门基础:WAV专题(6)——通过FFprobe显示WAV音频文件每个数据包的信息》中我们可以知道,通过FFprobe命令可以打印WAV音频文件每个packet(也称为数据包或多媒体包)的信息,这些信息包含该packet的pts、dts: 打印出来的“pts”实际是AVPacket结构体中的成员变量pts,是以AVStream->time_base为单位的显

kubelet组件的启动流程源码分析

概述 摘要: 本文将总结kubelet的作用以及原理,在有一定基础认识的前提下,通过阅读kubelet源码,对kubelet组件的启动流程进行分析。 正文 kubelet的作用 这里对kubelet的作用做一个简单总结。 节点管理 节点的注册 节点状态更新 容器管理(pod生命周期管理) 监听apiserver的容器事件 容器的创建、删除(CRI) 容器的网络的创建与删除

PDF 软件如何帮助您编辑、转换和保护文件。

如何找到最好的 PDF 编辑器。 无论您是在为您的企业寻找更高效的 PDF 解决方案,还是尝试组织和编辑主文档,PDF 编辑器都可以在一个地方提供您需要的所有工具。市面上有很多 PDF 编辑器 — 在决定哪个最适合您时,请考虑这些因素。 1. 确定您的 PDF 文档软件需求。 不同的 PDF 文档软件程序可以具有不同的功能,因此在决定哪个是最适合您的 PDF 软件之前,请花点时间评估您的

C# double[] 和Matlab数组MWArray[]转换

C# double[] 转换成MWArray[], 直接赋值就行             MWNumericArray[] ma = new MWNumericArray[4];             double[] dT = new double[] { 0 };             double[] dT1 = new double[] { 0,2 };