Gece gece bana lazım oldu 15 dk kadar uğraştım ve algoritmaya uygun bir function yazdım, sizlere de lazım olur belki.
Public Shared Function isValidTCno(TCno As String) As Boolean
TCno = Trim(TCno) : If String.IsNullOrEmpty(TCno) = True Then : Return False
Else : If Len(TCno) = 11 Then : Dim s1 As Integer = Right(TCno, 1)
Dim s2 As Integer = Left(TCno, 1) : If s2 = 0 Then : Return False
Else : If s1 Mod 2 = 0 Then
Dim t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11 As Integer : t1 = Left(TCno, 1)
t2 = TCno.Substring(1, 1) : t3 = TCno.Substring(2, 1)
t4 = TCno.Substring(3, 1) : t5 = TCno.Substring(4, 1)
t6 = TCno.Substring(5, 1) : t7 = TCno.Substring(6, 1)
t8 = TCno.Substring(7, 1) : t9 = TCno.Substring(8, 1)
t10 = TCno.Substring(9, 1) : t11 = TCno.Substring(10, 1)
Dim i1 As Double = (t1 + t3 + t5 + t7 + t9) * 7 : Dim i2 As Double = t2 + t4 + t6 + t8
Dim i3 As Double = i1 - i2 : Dim i4 As Double = t1 + t2 + t3 + t4 + t5 + t6 + t7 + t8 + t9 + t10
Dim i5 As Double = Right(i4, 1) : If i3 Mod 10 = t10 AndAlso i5 = t11 Then : Return True
Else : Return False : End If
Else : Return False : End If
End If
Else : Return False
End If
End If
End Function