굿

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

'======================================================
' 주민번호 검증 함수
'======================================================
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,717
14년 전 조회 1,952
14년 전 조회 1,634
14년 전 조회 2,115
14년 전 조회 2,249
14년 전 조회 1,432
14년 전 조회 2,691
14년 전 조회 2,678
14년 전 조회 2,247
14년 전 조회 2,207
14년 전 조회 1,718
14년 전 조회 2,205
14년 전 조회 2,107
14년 전 조회 1,843
14년 전 조회 1,538
14년 전 조회 3,278
14년 전 조회 2,606
14년 전 조회 1,964
14년 전 조회 2,606
14년 전 조회 1,481
14년 전 조회 1,591
14년 전 조회 2,225
14년 전 조회 2,303
14년 전 조회 1,919
14년 전 조회 1,607
14년 전 조회 1,772
14년 전 조회 1,733
14년 전 조회 2,540
14년 전 조회 2,664
14년 전 조회 2,570
14년 전 조회 1,679
14년 전 조회 2,262
14년 전 조회 2,305
14년 전 조회 2,382
14년 전 조회 4,177
14년 전 조회 1,710
14년 전 조회 2,536
14년 전 조회 1,446
14년 전 조회 1,580
14년 전 조회 1,432
15년 전 조회 1,883
15년 전 조회 2,296
15년 전 조회 1,857
15년 전 조회 1,716
15년 전 조회 1,375
15년 전 조회 2,361
15년 전 조회 1,942
15년 전 조회 1,477
15년 전 조회 2,862
15년 전 조회 1,978
15년 전 조회 1,900
15년 전 조회 1,428
15년 전 조회 2,298
15년 전 조회 3,266
15년 전 조회 1,655
15년 전 조회 1,113
15년 전 조회 2,641
15년 전 조회 2,387
15년 전 조회 1,333
15년 전 조회 1,917
15년 전 조회 2,077
15년 전 조회 1,931
15년 전 조회 1,299
15년 전 조회 1,268
15년 전 조회 1,592
15년 전 조회 1,894
15년 전 조회 1,746
15년 전 조회 1,422
15년 전 조회 1,867
15년 전 조회 1,693
15년 전 조회 1,965
15년 전 조회 1,437
15년 전 조회 1,677
15년 전 조회 1,474
15년 전 조회 1,825
15년 전 조회 1,293
15년 전 조회 2,687
15년 전 조회 1,897
15년 전 조회 3,478
15년 전 조회 1,871
15년 전 조회 1,630
15년 전 조회 1,694
15년 전 조회 1,691
15년 전 조회 1,140
15년 전 조회 1,400
15년 전 조회 1,461
15년 전 조회 2,908
15년 전 조회 1,550
15년 전 조회 3,916
15년 전 조회 1,390
15년 전 조회 1,218
15년 전 조회 1,302
15년 전 조회 2,274
15년 전 조회 1,900
15년 전 조회 1,699
15년 전 조회 1,761
15년 전 조회 1,673
15년 전 조회 1,775
15년 전 조회 1,439
15년 전 조회 1,040