Compiling ASP applications to become an exe file

zhaozj2021-02-16  43

Using NetBox can easily compile ASP applications into independent execution programs, completely get rid of IIS, running directly on almost all Windows versions, do not need to consider platform compatibility and requirements for ASP operations. Below is the step of rapidly porting existing ASP applications.

First, create an ASP operating environment

First create an empty directory, where you like, assuming is d: / websVR. Create a file in the directory: main.box, edit its content:

DIM HTTPD

Shell.Service.Runservice "NBWeb", "NetBox Web Server", "NetBox Http Server Sample"

'---------------------- Service Event ---------------------

Sub onservicestart ()

Set httpd = creteObject ("NetBox.httpserver")

IF httpd.create (", 80) = 0 THEN

Set host = httpd.addhost ("", "/ wwwroot")

Host.enableScript = TRUE

Host.adddefault "default.asp"

Host.adddefault "default.htm"

httpd.start

Else

Shell.quit 0

END IF

End Sub

SUB ONSERVICESTOP ()

httpd.close

End Sub

SUB ONSERVICEPAUSE ()

httpd.stop

End Sub

Sub onserviceResume ()

httpd.start

End Sub

The above code is taken from "Create a web server". Among them, the bold part is the default file name. If your application is different, you can add a modification yourself.

Second, copy the ASP application

Create a subdirectory in the directory: wwwroot, copy all the files in IIS to wwwroot. At this point, your ASP running environment should be ready.

Third, test operation

In order to run the new NetBox app you just created, you must confirm that your IIS or other occupied 80-port programs have stopped, bigger may be your IIS in using this port, so it is best to stop your IIS, or put IIS Replace with ports to other ports.

After ensuring IIS has stopped, you can perform your NetBox app. Double click on the main.box file, soon, you will see the icon of NetBox in the lower right corner of the window. At this point, NetBox is running normally. What you need to do is to use IE to access http: // localhost to test whether your ASP application has been running normally. In general, the ASP has also been running completely.

Fourth, compile

The process of compilation is simple, perform nbdw.exe.

Sore SELECT Folder, find the directory D: / WebsVR, point Browser, which we have established just now, set the execution file name to generate, click Build ..., start compilation.

Success ...

Finally, we got the execution file that compiled success, this is our last goal.

Because this routine is a web server created with a service, you can use:

MyApp -install

The application is installed as a service so that the system can automatically run the application without logins. If you need to uninstall the service, you can do the following command: myapp -remove