굿

주민번호 및 사업자번호 검증

'======================================================
' 주민번호 검증 함수
'======================================================
Public Function IsJuminNum(ByVal strJuminNum As String) As Boolean
Dim iSum As Integer
Dim iRe As Integer

On Error GoTo Wrong_Number

strJuminNum = Char_Remove(strJuminNum)

If Len(strJuminNum) <> 13 Then
IsJuminNum = False
Exit Function
End If
If CInt(Mid(strJuminNum, 3, 2)) < 0 Or CInt(Mid(strJuminNum, 3, 2)) > 12 Or _
CInt(Mid(strJuminNum, 5, 2)) < 0 Or CInt(Mid(strJuminNum, 5, 2)) > 31 Or _
CInt(Mid(strJuminNum, 7, 1)) < 0 Or CInt(Mid(strJuminNum, 7, 1)) > 4 Then
IsJuminNum = False
Exit Function
End If
iSum = CInt(Mid(strJuminNum, 1, 1)) * 2 + _
CInt(Mid(strJuminNum, 2, 1)) * 3 + _
CInt(Mid(strJuminNum, 3, 1)) * 4 + _
CInt(Mid(strJuminNum, 4, 1)) * 5 + _
CInt(Mid(strJuminNum, 5, 1)) * 6 + _
CInt(Mid(strJuminNum, 6, 1)) * 7 + _
CInt(Mid(strJuminNum, 7, 1)) * 8 + _
CInt(Mid(strJuminNum, 8, 1)) * 9 + _
CInt(Mid(strJuminNum, 9, 1)) * 2 + _
CInt(Mid(strJuminNum, 10, 1)) * 3 + _
CInt(Mid(strJuminNum, 11, 1)) * 4 + _
CInt(Mid(strJuminNum, 12, 1)) * 5

iSum = iSum Mod 11
iRe = 11 - iSum
If iRe > 9 Then
iRe = iRe Mod 10
End If

iSum = CInt(Mid(strJuminNum, 13, 1))

If iSum = iRe Then
IsJuminNum = True
Else
IsJuminNum = False
End If
Exit Function
Wrong_Number:
IsJuminNum = False
End Function


'======================================================
' 사업자번호 검증 함수
'======================================================
Public Function IsSaupjaNo(ByVal strSaupjaNo As String) As Boolean
Dim iSum As Integer
Dim iRe As Integer

On Error GoTo Wrong_Number

strSaupjaNo = Char_Remove(strSaupjaNo)

If Len(strSaupjaNo) <> 10 Then
IsSaupjaNo = False
Exit Function
End If
iSum = ((CInt(Mid(strSaupjaNo, 9, 1)) * 5) \ 10) + _
((CInt(Mid(strSaupjaNo, 9, 1)) * 5) Mod 10) + _
CInt(Mid(strSaupjaNo, 1, 1)) + CInt(Mid(strSaupjaNo, 4, 1)) + CInt(Mid(strSaupjaNo, 7, 1)) + _
(CInt(Mid(strSaupjaNo, 2, 1)) + CInt(Mid(strSaupjaNo, 5, 1)) + CInt(Mid(strSaupjaNo, 8, 1))) * 3 + _
(CInt(Mid(strSaupjaNo, 3, 1)) + CInt(Mid(strSaupjaNo, 6, 1))) * 7

iSum = iSum Mod 10
If CInt(Mid(strSaupjaNo, 10, 1)) = ((10 - iSum) Mod 10) Then
IsSaupjaNo = True
Else
IsSaupjaNo = False
End If
Exit Function
Wrong_Number:
IsSaupjaNo = False
End Function<div class='small'>[이 게시물은 관리자님에 의해 2011-10-31 16:46:12 기타에서 이동 됨]</div>
|

댓글 2개

베이직인가요?
ASP 도 베이직문법이라.. ASP 일수도 있겠네요..
댓글을 작성하시려면 로그인이 필요합니다.

프로그램

+
제목 글쓴이 날짜 조회
14년 전 조회 4,743
14년 전 조회 1,972
14년 전 조회 1,655
14년 전 조회 2,142
14년 전 조회 2,275
14년 전 조회 1,462
14년 전 조회 2,712
14년 전 조회 2,705
14년 전 조회 2,277
14년 전 조회 2,230
14년 전 조회 1,740
14년 전 조회 2,229
14년 전 조회 2,135
14년 전 조회 1,873
14년 전 조회 1,555
14년 전 조회 3,298
14년 전 조회 2,626
14년 전 조회 1,988
14년 전 조회 2,625
14년 전 조회 1,504
14년 전 조회 1,607
14년 전 조회 2,242
14년 전 조회 2,315
14년 전 조회 1,939
14년 전 조회 1,627
14년 전 조회 1,789
14년 전 조회 1,756
14년 전 조회 2,555
14년 전 조회 2,684
14년 전 조회 2,585
14년 전 조회 1,696
14년 전 조회 2,284
14년 전 조회 2,318
14년 전 조회 2,394
14년 전 조회 4,194
14년 전 조회 1,729
14년 전 조회 2,553
15년 전 조회 1,466
15년 전 조회 1,604
15년 전 조회 1,448
15년 전 조회 1,898
15년 전 조회 2,324
15년 전 조회 1,872
15년 전 조회 1,738
15년 전 조회 1,393
15년 전 조회 2,374
15년 전 조회 1,949
15년 전 조회 1,500
15년 전 조회 2,879
15년 전 조회 1,991
15년 전 조회 1,912
15년 전 조회 1,438
15년 전 조회 2,325
15년 전 조회 3,285
15년 전 조회 1,669
15년 전 조회 1,128
15년 전 조회 2,658
15년 전 조회 2,401
15년 전 조회 1,351
15년 전 조회 1,930
15년 전 조회 2,089
15년 전 조회 1,944
15년 전 조회 1,316
15년 전 조회 1,283
15년 전 조회 1,613
15년 전 조회 1,912
15년 전 조회 1,760
15년 전 조회 1,441
15년 전 조회 1,887
15년 전 조회 1,714
15년 전 조회 1,977
15년 전 조회 1,460
15년 전 조회 1,700
15년 전 조회 1,486
15년 전 조회 1,839
15년 전 조회 1,309
15년 전 조회 2,701
15년 전 조회 1,908
15년 전 조회 3,493
15년 전 조회 1,886
15년 전 조회 1,640
15년 전 조회 1,710
15년 전 조회 1,703
15년 전 조회 1,151
15년 전 조회 1,406
15년 전 조회 1,476
15년 전 조회 2,927
15년 전 조회 1,562
15년 전 조회 3,934
15년 전 조회 1,402
15년 전 조회 1,227
15년 전 조회 1,313
15년 전 조회 2,299
15년 전 조회 1,909
15년 전 조회 1,715
15년 전 조회 1,771
15년 전 조회 1,685
15년 전 조회 1,795
15년 전 조회 1,447
15년 전 조회 1,056