Foxtable(狐表)用户栏目专家坐堂 → 车辆VIN码校验位算法


  共有3143人关注过本帖树形打印复制链接

主题:车辆VIN码校验位算法

帅哥哟,离线,有人找我吗?
大红袍
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2015/10/20 11:47:00 [显示全部帖子]

直接去拿例子的代码配上去。

 回到顶部
帅哥哟,离线,有人找我吗?
大红袍
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2015/10/20 12:18:00 [显示全部帖子]

mark 车辆识别码

 

Dim q() As Integer = {8,7,6,5,4,3,2,10,1,9,8,7,6,5,4,3,2}
Dim v() As Integer = {0,1,2,3,4,5,6,7,8,9,1,2,3,4,5,6,7,8,1,2,3,4,5,7,9,2,3,4,5,6,7,8,9}
Dim w() As String = {0,1,2,3,4,5,6,7,8,9,"A","B","C","D","E","F","G","H","J","K","L","M","N","P","R","S","T","U","V","W","X","W","Z"}
Dim num As String = "UU6JA69691D713820"
Dim sum As Double = 0
For i As Integer = 0 To num.length - 1
    Dim s As String = num(i)
    sum += v(array.indexOf(w,s.ToUpper)) * q(i)
Next
Dim n9 As String = num(8)
sum = (sum - n9) Mod 11
msgbox(sum)

[此贴子已经被作者于2015/10/20 12:18:32编辑过]

 回到顶部