굿

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

'======================================================
' 주민번호 검증 함수
'======================================================
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,115
14년 전 조회 1,353
14년 전 조회 1,055
14년 전 조회 1,480
14년 전 조회 1,647
14년 전 조회 846
14년 전 조회 2,094
14년 전 조회 2,069
14년 전 조회 1,655
14년 전 조회 1,607
14년 전 조회 1,125
14년 전 조회 1,603
14년 전 조회 1,533
14년 전 조회 1,243
14년 전 조회 976
14년 전 조회 2,725
14년 전 조회 2,035
14년 전 조회 1,391
14년 전 조회 2,047
14년 전 조회 923
14년 전 조회 1,023
14년 전 조회 1,648
14년 전 조회 1,751
14년 전 조회 1,354
14년 전 조회 1,045
14년 전 조회 1,213
14년 전 조회 1,148
14년 전 조회 1,996
14년 전 조회 2,122
14년 전 조회 1,996
14년 전 조회 1,130
14년 전 조회 1,698
14년 전 조회 1,755
14년 전 조회 1,850
14년 전 조회 3,623
14년 전 조회 1,176
14년 전 조회 1,975
14년 전 조회 891
14년 전 조회 1,024
14년 전 조회 875
14년 전 조회 1,327
14년 전 조회 1,784
14년 전 조회 1,322
14년 전 조회 1,173
14년 전 조회 832
14년 전 조회 1,811
14년 전 조회 1,382
14년 전 조회 943
14년 전 조회 2,327
14년 전 조회 1,442
14년 전 조회 1,361
14년 전 조회 896
14년 전 조회 1,768
14년 전 조회 2,738
14년 전 조회 1,235
14년 전 조회 631
14년 전 조회 2,195
14년 전 조회 1,951
14년 전 조회 901
14년 전 조회 1,483
14년 전 조회 1,658
14년 전 조회 1,518
14년 전 조회 879
14년 전 조회 847
14년 전 조회 1,155
14년 전 조회 1,481
14년 전 조회 1,333
14년 전 조회 1,017
14년 전 조회 1,445
14년 전 조회 1,291
14년 전 조회 1,566
14년 전 조회 1,013
14년 전 조회 1,252
14년 전 조회 1,050
14년 전 조회 1,409
14년 전 조회 874
14년 전 조회 2,266
14년 전 조회 1,478
14년 전 조회 3,078
14년 전 조회 1,452
14년 전 조회 1,223
14년 전 조회 1,270
14년 전 조회 1,273
14년 전 조회 737
14년 전 조회 997
14년 전 조회 1,039
14년 전 조회 2,496
14년 전 조회 1,132
14년 전 조회 3,495
14년 전 조회 968
14년 전 조회 801
14년 전 조회 868
14년 전 조회 1,850
14년 전 조회 1,472
14년 전 조회 1,284
14년 전 조회 1,344
14년 전 조회 1,273
14년 전 조회 1,377
14년 전 조회 1,034
14년 전 조회 638
🐛 버그신고