굿

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

'======================================================
' 주민번호 검증 함수
'======================================================
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,649
14년 전 조회 1,883
14년 전 조회 1,571
14년 전 조회 2,054
14년 전 조회 2,178
14년 전 조회 1,380
14년 전 조회 2,623
14년 전 조회 2,616
14년 전 조회 2,182
14년 전 조회 2,150
14년 전 조회 1,657
14년 전 조회 2,145
14년 전 조회 2,045
14년 전 조회 1,788
14년 전 조회 1,468
14년 전 조회 3,226
14년 전 조회 2,538
14년 전 조회 1,899
14년 전 조회 2,546
14년 전 조회 1,418
14년 전 조회 1,534
14년 전 조회 2,161
14년 전 조회 2,241
14년 전 조회 1,862
14년 전 조회 1,544
14년 전 조회 1,716
14년 전 조회 1,664
14년 전 조회 2,483
14년 전 조회 2,618
14년 전 조회 2,503
14년 전 조회 1,626
14년 전 조회 2,207
14년 전 조회 2,233
14년 전 조회 2,322
14년 전 조회 4,129
14년 전 조회 1,650
14년 전 조회 2,483
14년 전 조회 1,389
14년 전 조회 1,523
14년 전 조회 1,381
14년 전 조회 1,819
14년 전 조회 2,249
14년 전 조회 1,798
14년 전 조회 1,646
14년 전 조회 1,322
14년 전 조회 2,302
14년 전 조회 1,888
14년 전 조회 1,409
14년 전 조회 2,818
14년 전 조회 1,923
14년 전 조회 1,847
14년 전 조회 1,376
14년 전 조회 2,254
15년 전 조회 3,216
15년 전 조회 1,614
15년 전 조회 1,072
15년 전 조회 2,602
15년 전 조회 2,337
15년 전 조회 1,285
15년 전 조회 1,859
15년 전 조회 2,029
15년 전 조회 1,868
15년 전 조회 1,248
15년 전 조회 1,229
15년 전 조회 1,537
15년 전 조회 1,849
15년 전 조회 1,707
15년 전 조회 1,390
15년 전 조회 1,814
15년 전 조회 1,647
15년 전 조회 1,924
15년 전 조회 1,390
15년 전 조회 1,634
15년 전 조회 1,431
15년 전 조회 1,774
15년 전 조회 1,252
15년 전 조회 2,648
15년 전 조회 1,851
15년 전 조회 3,434
15년 전 조회 1,831
15년 전 조회 1,596
15년 전 조회 1,651
15년 전 조회 1,640
15년 전 조회 1,095
15년 전 조회 1,366
15년 전 조회 1,416
15년 전 조회 2,872
15년 전 조회 1,500
15년 전 조회 3,875
15년 전 조회 1,344
15년 전 조회 1,175
15년 전 조회 1,250
15년 전 조회 2,237
15년 전 조회 1,843
15년 전 조회 1,657
15년 전 조회 1,709
15년 전 조회 1,632
15년 전 조회 1,739
15년 전 조회 1,396
15년 전 조회 1,006