굿

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

'======================================================
' 주민번호 검증 함수
'======================================================
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,720
14년 전 조회 1,956
14년 전 조회 1,641
14년 전 조회 2,121
14년 전 조회 2,250
14년 전 조회 1,435
14년 전 조회 2,695
14년 전 조회 2,686
14년 전 조회 2,250
14년 전 조회 2,216
14년 전 조회 1,723
14년 전 조회 2,208
14년 전 조회 2,112
14년 전 조회 1,849
14년 전 조회 1,540
14년 전 조회 3,284
14년 전 조회 2,611
14년 전 조회 1,967
14년 전 조회 2,609
14년 전 조회 1,488
14년 전 조회 1,593
14년 전 조회 2,229
14년 전 조회 2,306
14년 전 조회 1,925
14년 전 조회 1,610
14년 전 조회 1,775
14년 전 조회 1,737
14년 전 조회 2,543
14년 전 조회 2,671
14년 전 조회 2,571
14년 전 조회 1,682
14년 전 조회 2,265
14년 전 조회 2,306
14년 전 조회 2,385
14년 전 조회 4,180
14년 전 조회 1,717
14년 전 조회 2,537
14년 전 조회 1,451
14년 전 조회 1,585
14년 전 조회 1,435
15년 전 조회 1,885
15년 전 조회 2,302
15년 전 조회 1,861
15년 전 조회 1,721
15년 전 조회 1,378
15년 전 조회 2,362
15년 전 조회 1,942
15년 전 조회 1,480
15년 전 조회 2,864
15년 전 조회 1,982
15년 전 조회 1,901
15년 전 조회 1,430
15년 전 조회 2,305
15년 전 조회 3,270
15년 전 조회 1,656
15년 전 조회 1,116
15년 전 조회 2,643
15년 전 조회 2,390
15년 전 조회 1,336
15년 전 조회 1,920
15년 전 조회 2,082
15년 전 조회 1,934
15년 전 조회 1,302
15년 전 조회 1,273
15년 전 조회 1,598
15년 전 조회 1,899
15년 전 조회 1,748
15년 전 조회 1,426
15년 전 조회 1,870
15년 전 조회 1,701
15년 전 조회 1,966
15년 전 조회 1,440
15년 전 조회 1,680
15년 전 조회 1,476
15년 전 조회 1,828
15년 전 조회 1,298
15년 전 조회 2,692
15년 전 조회 1,900
15년 전 조회 3,481
15년 전 조회 1,875
15년 전 조회 1,633
15년 전 조회 1,702
15년 전 조회 1,692
15년 전 조회 1,145
15년 전 조회 1,402
15년 전 조회 1,462
15년 전 조회 2,912
15년 전 조회 1,551
15년 전 조회 3,920
15년 전 조회 1,395
15년 전 조회 1,219
15년 전 조회 1,303
15년 전 조회 2,279
15년 전 조회 1,903
15년 전 조회 1,706
15년 전 조회 1,762
15년 전 조회 1,674
15년 전 조회 1,777
15년 전 조회 1,440
15년 전 조회 1,045