根据输入的号码显示信用卡图像
有人有根据输入的卡号动态显示信用卡图像的经验吗?
是否有某种可用的列表来运行 if then 来将图像设置为可见或隐藏?
任何帮助/建议表示赞赏 谢谢
Anyone have any experience with displaying a credit card image dynamically based on the card number entered?
Is there some sort of usable list to run an if then against to set an image to visible or hidden?
Any help/advice is appreciated
Thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据维基百科,
接下来是 IIN 表格,它揭示了这个问题的许多秘密:它实际上最多六位数字,通常是一位、三位或四位。例如,如果以 4 开头,则它是 VISA(或联名 Dankort 卡),除非前四位数字是 4903、4905、4911 或 4936,在这种情况下它是 Switch 借记卡。但是切换卡不再存在; 2002 年,它们被出售给万事达卡,更名为 Maestro,并发行了新卡。然而,某人的孩子可能会从阁楼上挖出一个并尝试使用它。
这在逻辑上没有什么困难或聪明的地方。它只是对不同长度的前缀的一系列比较。合理的实现是一系列子字符串或正则表达式比较,if/else/else/else 等。
trie< /a> 写起来会更有趣,但是将这种代码留给潜在无能(或只是忙碌)的继任者来维护并不是真正的板球。
According to Wikipedia,
This is followed by table of IIN's which sheds much darkness on the matter: It's really up to six digits, usually one, three, or four. For example, if it starts with 4, it's a VISA (or a co-branded Dankort card), unless the first four digits are 4903, 4905, 4911, or 4936, in which case it's a Switch debit card. But Switch cards no longer exist; they were sold to MasterCard in 2002, rebranded as Maestro, and new cards were issued. Nevertheless somebody's kid may dig one out of the attic and try to use it.
There's nothing logically difficult or clever about it; it's just a series of comparisons to prefixes of varying lengths. The sensible implementation would be a series of substring or regex comparisons, if/else/else/else etc.
A trie would be much more fun to write but it's not really cricket to leave that kind of code for potentially incompetent (or just busy) successors to maintain.