现有的用于解析驾驶执照信息的库?

发布于 2024-12-01 07:31:06 字数 154 浏览 1 评论 0原文

是否有现有的 C# 库可用于解析驾驶执照中的信息?我希望直接从刷卡阅读器解析数据,因此它是一个长字符串,需要分解为其组件。我知道这是一个很大的请求,所以我对数字验证甚至许可证 ID 本身不感兴趣,我真的只想解析出名字和姓氏。我最终对所有 50 个州都感兴趣,但想先看看亚利桑那州和加利福尼亚州。

Is there an existing C# library that can be used to parse the information from a driver's license? I'm looking to parse the data directly from a swipe reader, so its a long string that needs to be broken down into it's components. I know that this is a big request, so I'm not interested in the validation of the numbers or even the license ID itself, I really just want to parse out the first and last name. I'm eventually interested in all 50 states but would like to see AZ and CA first.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

树深时见影 2024-12-08 07:31:06

我意识到这个问题很久以前就被问过;但我实际上不同意@FishBasketGordo 的观点:答案是否定的;如果您阅读这篇维基百科文章,您会看到一个非常明确指定的格式,所有美国驾驶执照(带有磁条)应该遵守 AAMVA 标准中的规定。

我个人在 JavaScript 库上做了一些工作 完全按照您的要求进行操作(提取姓名、号码,以及在我的情况下提取其他一些信息),并且在我能够测试的状态下取得了成功。不过,显然我还没有获得所有 50 个州的许可证。

无论如何,虽然我不知道您可以利用哪个库,但我仍然想权衡这个问题并建议这应该是可能的。

I realize this question was asked quite a while ago; but I actually don't agree with @FishBasketGordo that the answer is no; if you read this Wikipedia article you'll see a very clearly specified format that all U.S. driver's licenses (with magnetic stripes) supposedly adhere to, as specified in a standard by the AAMVA.

I personally have done some work on a JavaScript library to do exactly what you're asking (extract name, number, and in my case a few other bits of info) and have had success with the states I've been able to test. Obviously I haven't gotten my hands on licenses from all 50 states, though.

In any case, though I don't know of a library that you can leverage, I still wanted to weigh in on this question and suggest that this should be possible.

恬淡成诗 2024-12-08 07:31:06

我没有进行详尽的搜索,但我对此有一点经验,我相信答案是“否”。驾驶执照格式因州而异,并且可能经常发生变化。但是,如果您只查找名字和姓氏,那么通过反复试验应该很容易找出答案。据我所知,大多数深度学习都没有加密。只需通过超级终端或类似的东西设置读卡器,然后查看刷卡的输出。

编辑:请参阅@Dan Tao 的回答以及有关驾驶执照格式信息的评论。现在甚至可能有一个用于解析 AAMVA 兼容许可证数据的 C# 库(据我所知,2011 年还没有),这是最初的问题,这就是我回答“否”的原因。

I haven't done an exhaustive search, but I have a little experience with this and I believe the answer is "No". Driver's licence formats vary by state and could potentially change often. However, if you're looking for just the first and last name, that should be fairly easy to figure out by trial and error. Most DL's aren't encrypted from what I've seen. Just setup your card reader through Hyperterminal or something similar and look at the output from you card swipes.

Edit: Please see @Dan Tao's answer as well as the comments for information on driver's license formats. There might even be a C# library for parsing AAMVA compliant license data now (there wasn't in 2011 to my knowledge), which was the original question, which is why I replied "No".

机场等船 2024-12-08 07:31:06

我不熟悉根据 https://stackoverflow.com/users/783175/fishbasketgordo 更改的驾驶执照字符串在不同的州,但碰巧你有多种选择。

  1. 使用正则表达式。
  2. 像 JInt 包建议的那样使用 javascript(是在服务器上): http://jint.codeplex.com /discussions/240715 然后寻找 jQuery 或 node.js 插件
  3. 使用

I am not familiar with the driver's license strings which according to https://stackoverflow.com/users/783175/fishbasketgordo changes in various states, but it occurs to be that you have several choices.

  1. use regular expressions.
  2. use javascript (yes at the server) like suggested by the JInt package: http://jint.codeplex.com/discussions/240715 and then look for jQuery or node.js plugins
  3. use
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文