굿

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

'======================================================
' 주민번호 검증 함수
'======================================================
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,656
14년 전 조회 1,889
14년 전 조회 1,580
14년 전 조회 2,058
14년 전 조회 2,183
14년 전 조회 1,383
14년 전 조회 2,628
14년 전 조회 2,624
14년 전 조회 2,186
14년 전 조회 2,156
14년 전 조회 1,662
14년 전 조회 2,146
14년 전 조회 2,050
14년 전 조회 1,790
14년 전 조회 1,474
14년 전 조회 3,230
14년 전 조회 2,545
14년 전 조회 1,905
14년 전 조회 2,551
14년 전 조회 1,423
14년 전 조회 1,539
14년 전 조회 2,168
14년 전 조회 2,247
14년 전 조회 1,870
14년 전 조회 1,552
14년 전 조회 1,722
14년 전 조회 1,669
14년 전 조회 2,490
14년 전 조회 2,622
14년 전 조회 2,511
14년 전 조회 1,633
14년 전 조회 2,213
14년 전 조회 2,241
14년 전 조회 2,325
14년 전 조회 4,134
14년 전 조회 1,656
14년 전 조회 2,486
14년 전 조회 1,396
14년 전 조회 1,526
14년 전 조회 1,385
14년 전 조회 1,828
14년 전 조회 2,252
14년 전 조회 1,801
14년 전 조회 1,658
14년 전 조회 1,329
14년 전 조회 2,311
14년 전 조회 1,896
14년 전 조회 1,415
14년 전 조회 2,820
14년 전 조회 1,928
14년 전 조회 1,855
14년 전 조회 1,379
14년 전 조회 2,263
15년 전 조회 3,223
15년 전 조회 1,619
15년 전 조회 1,077
15년 전 조회 2,608
15년 전 조회 2,345
15년 전 조회 1,290
15년 전 조회 1,863
15년 전 조회 2,033
15년 전 조회 1,872
15년 전 조회 1,260
15년 전 조회 1,234
15년 전 조회 1,543
15년 전 조회 1,856
15년 전 조회 1,709
15년 전 조회 1,392
15년 전 조회 1,820
15년 전 조회 1,658
15년 전 조회 1,927
15년 전 조회 1,394
15년 전 조회 1,637
15년 전 조회 1,438
15년 전 조회 1,780
15년 전 조회 1,256
15년 전 조회 2,656
15년 전 조회 1,855
15년 전 조회 3,437
15년 전 조회 1,838
15년 전 조회 1,599
15년 전 조회 1,654
15년 전 조회 1,644
15년 전 조회 1,101
15년 전 조회 1,370
15년 전 조회 1,421
15년 전 조회 2,877
15년 전 조회 1,511
15년 전 조회 3,882
15년 전 조회 1,348
15년 전 조회 1,180
15년 전 조회 1,258
15년 전 조회 2,242
15년 전 조회 1,852
15년 전 조회 1,663
15년 전 조회 1,718
15년 전 조회 1,641
15년 전 조회 1,743
15년 전 조회 1,400
15년 전 조회 1,010