굿

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

'======================================================
' 주민번호 검증 함수
'======================================================
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,251
14년 전 조회 1,476
14년 전 조회 1,194
14년 전 조회 1,640
14년 전 조회 1,777
14년 전 조회 991
14년 전 조회 2,240
14년 전 조회 2,205
14년 전 조회 1,782
14년 전 조회 1,744
14년 전 조회 1,253
14년 전 조회 1,752
14년 전 조회 1,677
14년 전 조회 1,382
14년 전 조회 1,109
14년 전 조회 2,845
14년 전 조회 2,165
14년 전 조회 1,526
14년 전 조회 2,179
14년 전 조회 1,065
14년 전 조회 1,166
14년 전 조회 1,801
14년 전 조회 1,870
14년 전 조회 1,493
14년 전 조회 1,180
14년 전 조회 1,351
14년 전 조회 1,286
14년 전 조회 2,129
14년 전 조회 2,248
14년 전 조회 2,130
14년 전 조회 1,276
14년 전 조회 1,837
14년 전 조회 1,880
14년 전 조회 1,971
14년 전 조회 3,760
14년 전 조회 1,302
14년 전 조회 2,100
14년 전 조회 1,021
14년 전 조회 1,145
14년 전 조회 1,001
14년 전 조회 1,456
14년 전 조회 1,911
14년 전 조회 1,450
14년 전 조회 1,312
14년 전 조회 974
14년 전 조회 1,940
14년 전 조회 1,516
14년 전 조회 1,065
14년 전 조회 2,463
14년 전 조회 1,572
14년 전 조회 1,506
14년 전 조회 1,032
14년 전 조회 1,909
14년 전 조회 2,871
14년 전 조회 1,344
14년 전 조회 778
14년 전 조회 2,321
14년 전 조회 2,087
14년 전 조회 1,030
14년 전 조회 1,607
14년 전 조회 1,783
14년 전 조회 1,651
14년 전 조회 1,011
14년 전 조회 966
14년 전 조회 1,282
14년 전 조회 1,597
14년 전 조회 1,465
14년 전 조회 1,152
14년 전 조회 1,570
14년 전 조회 1,413
14년 전 조회 1,705
14년 전 조회 1,164
14년 전 조회 1,386
14년 전 조회 1,178
14년 전 조회 1,534
14년 전 조회 1,001
14년 전 조회 2,412
14년 전 조회 1,598
14년 전 조회 3,191
14년 전 조회 1,583
14년 전 조회 1,358
14년 전 조회 1,402
14년 전 조회 1,400
14년 전 조회 861
14년 전 조회 1,101
14년 전 조회 1,174
14년 전 조회 2,630
14년 전 조회 1,272
14년 전 조회 3,635
14년 전 조회 1,094
14년 전 조회 932
14년 전 조회 1,005
14년 전 조회 1,994
14년 전 조회 1,605
14년 전 조회 1,418
14년 전 조회 1,466
14년 전 조회 1,401
14년 전 조회 1,508
14년 전 조회 1,165
14년 전 조회 766