굿

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

'======================================================
' 주민번호 검증 함수
'======================================================
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,751
14년 전 조회 1,987
14년 전 조회 1,666
14년 전 조회 2,154
14년 전 조회 2,288
14년 전 조회 1,475
14년 전 조회 2,727
14년 전 조회 2,721
14년 전 조회 2,289
14년 전 조회 2,243
14년 전 조회 1,754
14년 전 조회 2,242
14년 전 조회 2,152
14년 전 조회 1,883
14년 전 조회 1,564
14년 전 조회 3,310
14년 전 조회 2,633
14년 전 조회 1,999
14년 전 조회 2,634
14년 전 조회 1,515
14년 전 조회 1,621
14년 전 조회 2,253
14년 전 조회 2,320
14년 전 조회 1,950
14년 전 조회 1,640
14년 전 조회 1,795
14년 전 조회 1,769
14년 전 조회 2,569
14년 전 조회 2,697
14년 전 조회 2,599
14년 전 조회 1,712
14년 전 조회 2,293
14년 전 조회 2,326
14년 전 조회 2,405
14년 전 조회 4,207
15년 전 조회 1,745
15년 전 조회 2,564
15년 전 조회 1,479
15년 전 조회 1,614
15년 전 조회 1,469
15년 전 조회 1,912
15년 전 조회 2,334
15년 전 조회 1,881
15년 전 조회 1,743
15년 전 조회 1,407
15년 전 조회 2,388
15년 전 조회 1,961
15년 전 조회 1,511
15년 전 조회 2,885
15년 전 조회 2,001
15년 전 조회 1,919
15년 전 조회 1,448
15년 전 조회 2,335
15년 전 조회 3,291
15년 전 조회 1,680
15년 전 조회 1,140
15년 전 조회 2,666
15년 전 조회 2,414
15년 전 조회 1,360
15년 전 조회 1,940
15년 전 조회 2,106
15년 전 조회 1,952
15년 전 조회 1,327
15년 전 조회 1,297
15년 전 조회 1,623
15년 전 조회 1,923
15년 전 조회 1,776
15년 전 조회 1,447
15년 전 조회 1,895
15년 전 조회 1,728
15년 전 조회 1,987
15년 전 조회 1,468
15년 전 조회 1,706
15년 전 조회 1,495
15년 전 조회 1,851
15년 전 조회 1,314
15년 전 조회 2,707
15년 전 조회 1,915
15년 전 조회 3,496
15년 전 조회 1,895
15년 전 조회 1,654
15년 전 조회 1,720
15년 전 조회 1,713
15년 전 조회 1,160
15년 전 조회 1,415
15년 전 조회 1,484
15년 전 조회 2,933
15년 전 조회 1,568
15년 전 조회 3,942
15년 전 조회 1,409
15년 전 조회 1,236
15년 전 조회 1,328
15년 전 조회 2,311
15년 전 조회 1,919
15년 전 조회 1,726
15년 전 조회 1,780
15년 전 조회 1,694
15년 전 조회 1,803
15년 전 조회 1,456
15년 전 조회 1,064