굿

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

'======================================================
' 주민번호 검증 함수
'======================================================
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,516
14년 전 조회 1,743
14년 전 조회 1,450
14년 전 조회 1,932
14년 전 조회 2,042
14년 전 조회 1,257
14년 전 조회 2,496
14년 전 조회 2,482
14년 전 조회 2,066
14년 전 조회 2,000
14년 전 조회 1,536
14년 전 조회 2,021
14년 전 조회 1,943
14년 전 조회 1,642
14년 전 조회 1,337
14년 전 조회 3,096
14년 전 조회 2,420
14년 전 조회 1,774
14년 전 조회 2,426
14년 전 조회 1,285
14년 전 조회 1,413
14년 전 조회 2,040
14년 전 조회 2,128
14년 전 조회 1,732
14년 전 조회 1,421
14년 전 조회 1,592
14년 전 조회 1,538
14년 전 조회 2,353
14년 전 조회 2,496
14년 전 조회 2,362
14년 전 조회 1,512
14년 전 조회 2,071
14년 전 조회 2,118
14년 전 조회 2,212
14년 전 조회 3,994
14년 전 조회 1,541
14년 전 조회 2,341
14년 전 조회 1,262
14년 전 조회 1,400
14년 전 조회 1,261
14년 전 조회 1,683
14년 전 조회 2,136
14년 전 조회 1,676
14년 전 조회 1,537
14년 전 조회 1,210
14년 전 조회 2,187
14년 전 조회 1,753
14년 전 조회 1,285
14년 전 조회 2,711
14년 전 조회 1,801
14년 전 조회 1,743
14년 전 조회 1,254
14년 전 조회 2,141
14년 전 조회 3,106
14년 전 조회 1,504
14년 전 조회 955
14년 전 조회 2,491
14년 전 조회 2,249
14년 전 조회 1,193
14년 전 조회 1,769
14년 전 조회 1,941
14년 전 조회 1,801
14년 전 조회 1,142
14년 전 조회 1,135
14년 전 조회 1,438
14년 전 조회 1,763
14년 전 조회 1,607
14년 전 조회 1,300
14년 전 조회 1,716
14년 전 조회 1,547
14년 전 조회 1,851
14년 전 조회 1,303
14년 전 조회 1,545
14년 전 조회 1,323
14년 전 조회 1,682
14년 전 조회 1,156
14년 전 조회 2,564
14년 전 조회 1,767
14년 전 조회 3,347
14년 전 조회 1,737
14년 전 조회 1,496
14년 전 조회 1,562
14년 전 조회 1,543
14년 전 조회 999
14년 전 조회 1,255
14년 전 조회 1,333
14년 전 조회 2,787
15년 전 조회 1,424
15년 전 조회 3,788
15년 전 조회 1,244
15년 전 조회 1,075
15년 전 조회 1,161
15년 전 조회 2,149
15년 전 조회 1,754
15년 전 조회 1,575
15년 전 조회 1,627
15년 전 조회 1,552
15년 전 조회 1,655
15년 전 조회 1,311
15년 전 조회 918