VB를 열고 새 AXDLL을 만들고 프로젝트 이름은 str이고 클래스 이름은 count이며 다음 코드를 입력합니다.
코드 사본은 다음과 같습니다.
PublicFunctionAdd (Byvalaasdouble, Byvalbasdouble, Byvalcasinteger, Byvaldasinteger) asdouble
d = 고린 (d)
ifc = 1then'add
add = formatnumber (a+b, d)
elseifc = 2then '감소
add = formatnumber (ab, d)
elseifc = 3then'multiple
add = formatnumber (a*b, d)
elseifc = 4then '
add = formatnumber (a/b, d)
endif
최종 기능 장애
매개 변수 설명 : A와 B는 계산할 값, C는 계산 유형이며 D는 소수점 지점입니다.
클라이언트 ASP 파일 코드 :
코드 사본은 다음과 같습니다.
setobj = server.createobject ( "str.count")
DIMC
c = obj.add (455,45,4,2)
응답 .writec
위의 코드 실행 결과는 455를 45로 나누고 소수점은 백분위 수에 정확합니다.