굿

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

'======================================================
' 주민번호 검증 함수
'======================================================
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,541
14년 전 조회 1,771
14년 전 조회 1,477
14년 전 조회 1,954
14년 전 조회 2,080
14년 전 조회 1,282
14년 전 조회 2,525
14년 전 조회 2,510
14년 전 조회 2,093
14년 전 조회 2,031
14년 전 조회 1,561
14년 전 조회 2,044
14년 전 조회 1,968
14년 전 조회 1,671
14년 전 조회 1,371
14년 전 조회 3,127
14년 전 조회 2,445
14년 전 조회 1,804
14년 전 조회 2,446
14년 전 조회 1,313
14년 전 조회 1,434
14년 전 조회 2,066
14년 전 조회 2,157
14년 전 조회 1,766
14년 전 조회 1,444
14년 전 조회 1,625
14년 전 조회 1,572
14년 전 조회 2,378
14년 전 조회 2,525
14년 전 조회 2,389
14년 전 조회 1,538
14년 전 조회 2,104
14년 전 조회 2,151
14년 전 조회 2,236
14년 전 조회 4,026
14년 전 조회 1,569
14년 전 조회 2,376
14년 전 조회 1,296
14년 전 조회 1,427
14년 전 조회 1,284
14년 전 조회 1,711
14년 전 조회 2,161
14년 전 조회 1,708
14년 전 조회 1,572
14년 전 조회 1,241
14년 전 조회 2,213
14년 전 조회 1,785
14년 전 조회 1,311
14년 전 조회 2,740
14년 전 조회 1,837
14년 전 조회 1,775
14년 전 조회 1,287
14년 전 조회 2,168
14년 전 조회 3,133
14년 전 조회 1,527
14년 전 조회 979
14년 전 조회 2,518
14년 전 조회 2,268
14년 전 조회 1,222
14년 전 조회 1,795
14년 전 조회 1,959
14년 전 조회 1,823
14년 전 조회 1,157
14년 전 조회 1,153
14년 전 조회 1,456
14년 전 조회 1,784
14년 전 조회 1,631
14년 전 조회 1,313
14년 전 조회 1,742
14년 전 조회 1,563
14년 전 조회 1,865
14년 전 조회 1,323
14년 전 조회 1,566
14년 전 조회 1,350
14년 전 조회 1,711
14년 전 조회 1,182
14년 전 조회 2,583
14년 전 조회 1,785
15년 전 조회 3,361
15년 전 조회 1,759
15년 전 조회 1,518
15년 전 조회 1,577
15년 전 조회 1,565
15년 전 조회 1,018
15년 전 조회 1,280
15년 전 조회 1,349
15년 전 조회 2,807
15년 전 조회 1,444
15년 전 조회 3,805
15년 전 조회 1,272
15년 전 조회 1,097
15년 전 조회 1,179
15년 전 조회 2,176
15년 전 조회 1,782
15년 전 조회 1,594
15년 전 조회 1,649
15년 전 조회 1,580
15년 전 조회 1,677
15년 전 조회 1,328
15년 전 조회 944