굿

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

'======================================================
' 주민번호 검증 함수
'======================================================
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,126
14년 전 조회 1,365
14년 전 조회 1,069
14년 전 조회 1,489
14년 전 조회 1,659
14년 전 조회 860
14년 전 조회 2,103
14년 전 조회 2,078
14년 전 조회 1,666
14년 전 조회 1,622
14년 전 조회 1,135
14년 전 조회 1,615
14년 전 조회 1,545
14년 전 조회 1,255
14년 전 조회 990
14년 전 조회 2,734
14년 전 조회 2,046
14년 전 조회 1,405
14년 전 조회 2,059
14년 전 조회 934
14년 전 조회 1,037
14년 전 조회 1,661
14년 전 조회 1,762
14년 전 조회 1,368
14년 전 조회 1,059
14년 전 조회 1,223
14년 전 조회 1,159
14년 전 조회 2,009
14년 전 조회 2,129
14년 전 조회 2,007
14년 전 조회 1,138
14년 전 조회 1,710
14년 전 조회 1,762
14년 전 조회 1,861
14년 전 조회 3,638
14년 전 조회 1,189
14년 전 조회 1,982
14년 전 조회 906
14년 전 조회 1,038
14년 전 조회 881
14년 전 조회 1,337
14년 전 조회 1,793
14년 전 조회 1,329
14년 전 조회 1,184
14년 전 조회 839
14년 전 조회 1,818
14년 전 조회 1,393
14년 전 조회 954
14년 전 조회 2,337
14년 전 조회 1,450
14년 전 조회 1,371
14년 전 조회 907
14년 전 조회 1,783
14년 전 조회 2,751
14년 전 조회 1,247
14년 전 조회 642
14년 전 조회 2,203
14년 전 조회 1,964
14년 전 조회 911
14년 전 조회 1,493
14년 전 조회 1,668
14년 전 조회 1,528
14년 전 조회 886
14년 전 조회 856
14년 전 조회 1,163
14년 전 조회 1,489
14년 전 조회 1,346
14년 전 조회 1,024
14년 전 조회 1,450
14년 전 조회 1,299
14년 전 조회 1,576
14년 전 조회 1,021
14년 전 조회 1,258
14년 전 조회 1,059
14년 전 조회 1,421
14년 전 조회 884
14년 전 조회 2,284
14년 전 조회 1,486
14년 전 조회 3,084
14년 전 조회 1,464
14년 전 조회 1,238
14년 전 조회 1,281
14년 전 조회 1,282
14년 전 조회 744
14년 전 조회 1,004
14년 전 조회 1,052
14년 전 조회 2,506
14년 전 조회 1,139
14년 전 조회 3,506
14년 전 조회 976
14년 전 조회 812
14년 전 조회 879
14년 전 조회 1,859
14년 전 조회 1,482
14년 전 조회 1,297
14년 전 조회 1,352
14년 전 조회 1,281
14년 전 조회 1,386
14년 전 조회 1,043
14년 전 조회 647