굿

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

'======================================================
' 주민번호 검증 함수
'======================================================
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,245
14년 전 조회 1,472
14년 전 조회 1,184
14년 전 조회 1,616
14년 전 조회 1,775
14년 전 조회 983
14년 전 조회 2,225
14년 전 조회 2,197
14년 전 조회 1,772
14년 전 조회 1,736
14년 전 조회 1,248
14년 전 조회 1,731
14년 전 조회 1,666
14년 전 조회 1,372
14년 전 조회 1,102
14년 전 조회 2,838
14년 전 조회 2,156
14년 전 조회 1,512
14년 전 조회 2,168
14년 전 조회 1,052
14년 전 조회 1,152
14년 전 조회 1,784
14년 전 조회 1,865
14년 전 조회 1,484
14년 전 조회 1,170
14년 전 조회 1,343
14년 전 조회 1,277
14년 전 조회 2,120
14년 전 조회 2,238
14년 전 조회 2,125
14년 전 조회 1,261
14년 전 조회 1,831
14년 전 조회 1,873
14년 전 조회 1,967
14년 전 조회 3,750
14년 전 조회 1,296
14년 전 조회 2,092
14년 전 조회 1,011
14년 전 조회 1,139
14년 전 조회 996
14년 전 조회 1,449
14년 전 조회 1,899
14년 전 조회 1,440
14년 전 조회 1,301
14년 전 조회 966
14년 전 조회 1,935
14년 전 조회 1,511
14년 전 조회 1,058
14년 전 조회 2,448
14년 전 조회 1,563
14년 전 조회 1,491
14년 전 조회 1,026
14년 전 조회 1,899
14년 전 조회 2,866
14년 전 조회 1,342
14년 전 조회 763
14년 전 조회 2,318
14년 전 조회 2,084
14년 전 조회 1,023
14년 전 조회 1,597
14년 전 조회 1,778
14년 전 조회 1,648
14년 전 조회 1,004
14년 전 조회 963
14년 전 조회 1,277
14년 전 조회 1,593
14년 전 조회 1,454
14년 전 조회 1,143
14년 전 조회 1,565
14년 전 조회 1,405
14년 전 조회 1,691
14년 전 조회 1,149
14년 전 조회 1,378
14년 전 조회 1,172
14년 전 조회 1,530
14년 전 조회 991
14년 전 조회 2,402
14년 전 조회 1,594
14년 전 조회 3,183
14년 전 조회 1,577
14년 전 조회 1,354
14년 전 조회 1,399
14년 전 조회 1,390
14년 전 조회 858
14년 전 조회 1,100
14년 전 조회 1,168
14년 전 조회 2,624
14년 전 조회 1,255
14년 전 조회 3,626
14년 전 조회 1,091
14년 전 조회 924
14년 전 조회 998
14년 전 조회 1,986
14년 전 조회 1,595
14년 전 조회 1,411
14년 전 조회 1,460
14년 전 조회 1,394
14년 전 조회 1,503
14년 전 조회 1,163
14년 전 조회 763