把你的网站装在盒子里

Netbox是一款国产的变异开发工具,提供开发、部署、移植web应用程序。使用netbox可以直接将asp应用编译为直接运行的ASP程序。 To url:http://www.netbox.cn/default.htm上下载。

一、安装

1、先将NETBOX安装。跟普通软件安装没有什么两样的!略过!

2、我们首先创建一个空目录,如 D:/web(或随便什么目录都行,桌面下都行,但最好是空的,因为方便打包),然后在在目录中创建一个新文件,并命名为:main.box,修改其内容如下:


Dim httpd
Shell.Service.RunService "NBWeb", "NetBox Web Server", "NetBox Http Server Sample"
Sub OnServiceStart()
Set httpd = CreateObject("NetBox.HttpServer")
If httpd.Create("", 80) = 0 Then
Set host = httpd.AddHost("", "/www")
host.EnableScript = true
host.AddDefault "index.htm"
host.AddDefault "index.asp"
host.AddDefault "default.htm"
host.AddDefault "default.asp"
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



最后保存!

说明:
(1):如果你成功安装了网络盒子,那么他的后缀是可以被识别的,图标 为红色 .b 的样子
(2):我把上面代码的主要内容讲一下:

httpd.Create("", 80)是指使用80端口开设服务器,如果不喜欢,可以更改为别的!
那么访问地址后面必须加 :端口号 才能正常访问

Set host = httpd.AddHost("", "/www") 中的www就是你放网站程序的目录。也就是一定要与第二步将建立的目录名称相同!

host.AddDefault "index.htm"     --/
host.AddDefault "index.asp"         | 这些就是指设置默认首页文件,
host.AddDefault "default.htm"      | 你可以自己更改,添加删除一行一个
host.AddDefault "default.asp"    --/


二、然后在D:/WEB下面创建一个名为 www 的目录,如:d:/web/www

其下创建一个 index.asp 文件,编辑内容如下:

<%
response.write "I Love You!"
%>


然后保存!

或者将你的asp程序 放到这个目录下比如bbsxp论坛程序!


三、调试运行

然后,我们双击运行 main.box,这时候,系统托盘处应该出现一个红色的 .b 样的小图标。
好,我们打开浏览器,地址栏输入:127.0.0.1,或 localhost 看看:

如果出现了 I Love You! ,说明成功了!


四、运行为服务

因为这个例程是以服务方式创建的 Web 服务器,所以你可以使用:myapp -install
将应用安装成为服务,这样,系统无须手动运行便可以自动运行了。
如果需要卸载服务,则可以执行下面的命令:myapp -remove 来删除服务

五、编译

编译的过程是简单的,执行 nbdw.exe(NetBox Deployment Wizard就是部署向导)。
1 点 选择文件夹 按钮,找到刚才我们建立的目录 d:/web,
2 然后点 浏览 按钮,
3 输入要生成的执行文件的目录和名称,
4 点 Build...,开始编译。

成功喽……
最后,我们得到了编译成功的那个执行文件,就是封装好的程序,可以复制到其它电脑上直接运行。很方便吧!

说明:
(1):把自己的电脑搭建成网络服务器是免费的,2.8版封装成EXE文件,也完全免费了,好像连免费注册都取消了。
(2):网络盒子的功能远远不止这些,我仅仅说了一些关于如何搭建能支持ASP的网络服务器,网络盒子的真正功能还等着大家去发掘呢?要知道,网络盒子才440KB,而它的说明文件却有5.63MB啊 

以下是一个基于JavaWeb的简单轮播图实现,同时在了一个div盒子: 1. HTML文件: ```html <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>JavaWeb轮播图</title> <style type="text/css"> .carousel { width: 800px; height: 600px; margin: 0 auto; position: relative; overflow: hidden; border: 1px solid #ccc; } .carousel img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: none; } .carousel img.active { display: block; } .carousel .previous-button, .carousel .next-button { position: absolute; top: 50%; transform: translateY(-50%); background: none; border: none; font-size: 24px; color: #fff; text-shadow: 1px 1px 1px #000; cursor: pointer; z-index: 1; } .carousel .previous-button { left: 0; } .carousel .next-button { right: 0; } </style> </head> <body> <div class="carousel"> <img src="images/1.jpg" class="active"> <img src="images/2.jpg"> <img src="images/3.jpg"> <button class="previous-button">❮</button> <button class="next-button">❯</button> </div> <script type="text/javascript"> var carousel = document.querySelector('.carousel'); var images = carousel.querySelectorAll('img'); var previousButton = carousel.querySelector('.previous-button'); var nextButton = carousel.querySelector('.next-button'); var currentIndex = 0; previousButton.addEventListener('click', function() { images[currentIndex].classList.remove('active'); currentIndex--; if (currentIndex < 0) { currentIndex = images.length - 1; } images[currentIndex].classList.add('active'); }); nextButton.addEventListener('click', function() { images[currentIndex].classList.remove('active'); currentIndex++; if (currentIndex >= images.length) { currentIndex = 0; } images[currentIndex].classList.add('active'); }); var timer = setInterval(function() { images[currentIndex].classList.remove('active'); currentIndex++; if (currentIndex >= images.length) { currentIndex = 0; } images[currentIndex].classList.add('active'); }, 3000); carousel.addEventListener('mouseover', function() { clearInterval(timer); }); carousel.addEventListener('mouseout', function() { timer = setInterval(function() { images[currentIndex].classList.remove('active'); currentIndex++; if (currentIndex >= images.length) { currentIndex = 0; } images[currentIndex].classList.add('active'); }, 3000); }); </script> </body> </html> ``` 2. CSS文件: ```css .carousel { width: 800px; height: 600px; margin: 0 auto; position: relative; overflow: hidden; border: 1px solid #ccc; } .carousel img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: none; } .carousel img.active { display: block; } .carousel .previous-button, .carousel .next-button { position: absolute; top: 50%; transform: translateY(-50%); background: none; border: none; font-size: 24px; color: #fff; text-shadow: 1px 1px 1px #000; cursor: pointer; z-index: 1; } .carousel .previous-button { left: 0; } .carousel .next-button { right: 0; } ``` 这个实现使用了HTML、CSS和JavaScript来实现轮播图,并通过CSS将轮播图在了一个div盒子
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值