1. ASPExec
-------------------------------------------------------------------------------------------------------------------------
설치 : c\windows\system32에 copy할 필요 없다. 임의의 폴더에 있으면 된다.
등록 : Regsvr32.exe ASPExec.dll
삭제 : Regsvr32.exe ASPExec.dll /u

<%
        Set Executor = Server.CreateObject("ASPExec.Execute")

        Executor.Application = "..\Aspexec\test.exe"

        Executor.Parameters = "12 34"

        Executor.ShowWindow = False

        Response.Write "Attempting to execute " & Executor.Application & "<br>"

        strResult = Executor.ExecuteDosApp

        Response.Write "The result of this call was: " & strResult
%>

* 특징
-------------------------------------------------------------------------------------------------------------------------
- 외부 Dll파일의 설치가 필요하다.
- Binary파일만 실행가능하다. java.exe를 이용한 java class파일 호출이 불가능하다.

 

 


2. WScript.Shell
-------------------------------------------------------------------------------------------------------------------------
<%
        Dim exe
        Dim cmd

        exe = "C:\java\jdk\bin\java.exe -jar D:\WEB_HOSTING\LocalUser\ftp.flower\www\Aspexec\connector.jar"
        cmd = exe + " 58.72.212.155 28910 20001010 1234 7201221025912 100000"

        dim wshell
        set wshell = server.createobject("wscript.shell")
        response.write cmd&"<br>"
        '객체 생성 실패시 에러
        if wshell is nothing then
         response.write "S201:WScript.Shell Initialization Failure"
        end If

        Set oExec = wshell.exec(cmd)
        '끝날때 까지 기다림
        Do While oExec.Status = 0
        Loop

        '출력 메세지를 화면 출력
        output = oExec.stdout.readall
        response.write output

        '리턴 코드
        ret = oExec.ExitCode
        response.write "ret="&ret&"<br>"

        '객체 소멸
        set wshell=nothing
%>

 

* 특징
-------------------------------------------------------------------------------------------------------------------------
- 별도 Dll필요없이 ASP자체 지원이다. 
- Binary파일만 뿐만아니라, java.exe를 이용한 java class파일 호출도 가능하다.