Using Netbox to compile ASP completely rid of IIS shackles

Source: Internet
Author: User
Tags iis

The use of Netbox can easily compile ASP application into a stand-alone execution program, completely free from the shackles of IIS, in almost all versions of Windows run directly above, there is no need to consider platform compatibility and ASP operating environment requirements. Here are the steps to quickly migrate an existing ASP application.

First, create ASP running environment

First create an empty directory in your preferred location, assuming it is d:websvr. To create a file in the directory: Main.box, edit its contents as:

Dim httpd

Shell.Service.RunService "Nbweb", "Netbox Web Server", "Netbox Http server Sample"

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

Sub Onservicestart ()

Set httpd = CreateObject ("Netbox.httpserver")

If httpd. Create ("", +) = 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 excerpted from "Creating a WEB server." The bold part is the default filename, and if your application is different, you can add your own modifications.

Second, replication ASP application

Create another subdirectory in the directory: wwwroot, copy all the files you have in IIS to Wwwroot. At this point, your ASP runtime environment should already be ready.

Third, test run

In order to run your newly created Netbox application, you must verify that your IIS or other 80 port-consuming programs have stopped, and that the larger possibility is that your IIS is using this port, so it is best to stop your IIS, or replace the use port of IIS with another port.

After you have ensured that IIS has stopped, you can perform your Netbox application. Double-click the Main.box file, and soon you'll see the Netbox icon in the lower-right corner of the window. At this point, the Netbox has been running normally. What you need to do is to use IE access http://localhost to test whether your ASP application is also working properly. In general, the ASP is also fully functional at this time.

Four, compile

The compilation process is simple and executes nbdw.exe.

Click Select Folder to find the directory we have just established d:websvr, point Browser, set the execution file name to generate, point build ..., start compiling.

Success ....

Finally, we get the execution file that compiles successfully, this is our final goal.

Because this routine is a WEB server created in a service way, you can use:

Myapp-install

Install the application into a service so that the system can automatically run the application without having to log on. If you need to uninstall the service, you can execute the following command:

Myapp-remove

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.