굿

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

'======================================================
' 주민번호 검증 함수
'======================================================
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,749
14년 전 조회 1,982
14년 전 조회 1,663
14년 전 조회 2,151
14년 전 조회 2,286
14년 전 조회 1,470
14년 전 조회 2,722
14년 전 조회 2,716
14년 전 조회 2,283
14년 전 조회 2,240
14년 전 조회 1,747
14년 전 조회 2,237
14년 전 조회 2,148
14년 전 조회 1,879
14년 전 조회 1,563
14년 전 조회 3,306
14년 전 조회 2,632
14년 전 조회 1,993
14년 전 조회 2,631
14년 전 조회 1,513
14년 전 조회 1,617
14년 전 조회 2,249
14년 전 조회 2,320
14년 전 조회 1,949
14년 전 조회 1,637
14년 전 조회 1,794
14년 전 조회 1,766
14년 전 조회 2,567
14년 전 조회 2,696
14년 전 조회 2,596
14년 전 조회 1,710
14년 전 조회 2,293
14년 전 조회 2,326
14년 전 조회 2,404
14년 전 조회 4,204
15년 전 조회 1,741
15년 전 조회 2,560
15년 전 조회 1,475
15년 전 조회 1,612
15년 전 조회 1,465
15년 전 조회 1,906
15년 전 조회 2,332
15년 전 조회 1,881
15년 전 조회 1,742
15년 전 조회 1,404
15년 전 조회 2,387
15년 전 조회 1,955
15년 전 조회 1,504
15년 전 조회 2,883
15년 전 조회 1,996
15년 전 조회 1,917
15년 전 조회 1,443
15년 전 조회 2,331
15년 전 조회 3,288
15년 전 조회 1,678
15년 전 조회 1,134
15년 전 조회 2,661
15년 전 조회 2,412
15년 전 조회 1,358
15년 전 조회 1,938
15년 전 조회 2,102
15년 전 조회 1,950
15년 전 조회 1,324
15년 전 조회 1,293
15년 전 조회 1,620
15년 전 조회 1,920
15년 전 조회 1,772
15년 전 조회 1,445
15년 전 조회 1,892
15년 전 조회 1,724
15년 전 조회 1,982
15년 전 조회 1,466
15년 전 조회 1,706
15년 전 조회 1,494
15년 전 조회 1,846
15년 전 조회 1,312
15년 전 조회 2,705
15년 전 조회 1,913
15년 전 조회 3,495
15년 전 조회 1,892
15년 전 조회 1,647
15년 전 조회 1,717
15년 전 조회 1,709
15년 전 조회 1,156
15년 전 조회 1,415
15년 전 조회 1,481
15년 전 조회 2,931
15년 전 조회 1,568
15년 전 조회 3,940
15년 전 조회 1,408
15년 전 조회 1,234
15년 전 조회 1,322
15년 전 조회 2,304
15년 전 조회 1,917
15년 전 조회 1,723
15년 전 조회 1,778
15년 전 조회 1,690
15년 전 조회 1,802
15년 전 조회 1,456
15년 전 조회 1,062