ICANN认证国际域名顶级注册机构
网站建设,域名注册,空间租用,软件销售,广告设计 域名注册,空间租用, 网站建设,东莞网页设计,域名注册,网站推广,网站开发,网页设计 网站推广,,百度推广,新浪推广,雅虎推广,网易推广 标志设计,画册设计,包装设计,VI策划,企业形象顾问 连邦软件加盟店,提供销遥行,管家婆,速达,用友ERP,诺顿等软件报价及销售 建站必读 腾达网络,上网帮助中心, 腾达为东莞等地,提供网站建设,网站推广,广告设计,软件销售等优质服务!
建站必读


 
 
当前位置:首页 -> 建站必读 -> ASP技术
Running An ASP Script As A Windows NT Service
SUMMARY



This tutorial will guide you through the steps of setting up and configuring a Windows NT Server or Workstation to execute an ASP script as a service. This will let you execute an ASP script without a user being logged on to the server, thus allowing you to use the ASP technology as a tool for automatic file processing or similar.



REQUIREMENTS



For this setup to work, the server must have the following software installed:





An ASP compliant web server. For instance, Microsoft Internet Information Server (IIS) version 3.0 or higher.

A webbrowser. For instance, Microsoft Internet Explorer.

The Windows NT Ressource Kit or at least the ServAny/InstSrv utilities available separately.

When doing all the following, you must be logged on as Administrator.



THE SCRIPT



The ASP script you want to run as a service should be written as plain ASP as you would normally do. Although, in case you want the script to "loop", you should make sure, that you output the appropriate HTML to initiate a reload of the script. This should look something like this:



   <%

       [ Perform whatever task you need ]

   %>



   <html>

   <head>

   <meta http-equiv="refresh" content="60; url=myScript.asp">

   </head>

   <body>

   ...

   </body>

   </html>



Generally, you would not generate any output, as the script will run in the background, not having anything to present to a user.



The HTML above assumes that the name of the script is myScript.asp and will reload the script (execute it) every 60 seconds.



Copy the script file to your webserver so it is accessible within the webserver namespace. From now on, I assume that you put it in the webserver root directory, so it is accessible via



http://localhost/myScript.asp



Eventually, test it using the webbrowser to make sure everything works as planned.



INSTALLING THE SERVICE



Setting up the service is pretty straight-forward if you follow the guideline provided with the NT Ressource Kit. Anyway, the following will guide you through just the nessecary steps.



We need the following files from the NT Ressource Kit:



   instsrv.exe        Utility to install Windows NT services

   srvany.exe         A service that will run any application



Although its optional, I recommend putting both files in your System32 directory. Now, start up a command prompt and execute this:



   instsrv myAspService srvany.exe



A new service named "myAspService" is now available through the Control Panel -> Services applet. Of course, you can provide any name you like.



CONFIGURING THE SERVICE



Now we need to configure the newly installed service to actually execute the script. As seen above, we need some host application to make the HTTP request - namely a webbrowser. In other words, we need to configure the service to execute the webbrowser with the appropriate URL as a parameter.



To configure the service, first open the Services applet in Control Panel. Locate the new service, double-click it, and make sure it is set to "Automatic" startup. Close the Control Panel applet.



Start up the registry editor (either regedit.exe or regedt32.exe).



Go to HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServices



Locate the name of your new service. Under this key, create a new key called "Parameters".



Under this new key, create the following two value/data pairs, both of type String/REG_SZ.



Value name:&nb
 
 
本站关键词:
|东莞网页设计|东莞网络公司|网站建设|网页设计|网络公司|网站制作|网站开发|东莞域名空间|东莞广告公司|东莞广告设计|网站建设东莞|东莞网站制作||东莞网页设计|东莞网络公司|网站建设|网页设计|网络公司|网站制作|网站开发|东莞域名空间|东莞广告公司|东莞广告设计|网站建设东莞|东莞网站制作||东莞网页设计|东莞网络公司|网站建设|网页设计|网络公司|网站制作|网站开发|东莞域名空间|东莞广告公司|东莞广告设计|网站建设东莞|东莞网站制作||东莞网页设计|东莞网络公司|网站建设|网页设计|网络公司|网站制作|网站开发|东莞域名空间|东莞广告公司|东莞广告设计|网站建设东莞|东莞网站制作||东莞网页设计|东莞网络公司|网站建设|网页设计|网络公司|网站制作|网站开发|东莞域名空间|东莞广告公司|东莞广告设计|网站建设东莞|东莞网站制作||东莞网页设计|东莞网络公司|网站建设|网页设计|网络公司|网站制作|网站开发|东莞域名空间|东莞广告公司|东莞广告设计|网站建设东莞|东莞网站制作||东莞网页设计|东莞网络公司|网站建设|网页设计|网络公司|网站制作|网站开发|东莞域名空间|东莞广告公司|东莞广告设计|网站建设东莞|东莞网站制作||东莞网页设计|东莞网络公司|网站建设|网页设计|网络公司|网站制作|网站开发|东莞域名空间|东莞广告公司|东莞广告设计|网站建设东莞|东莞网站制作||东莞网页设计|东莞网络公司|网站建设|网页设计|网络公司|网站制作|网站开发|东莞域名空间|东莞广告公司|东莞广告设计|网站建设东莞|东莞网站制作||东莞网页设计|东莞网络公司|网站建设|网页设计|网络公司|网站制作|网站开发|东莞域名空间|东莞广告公司|东莞广告设计|网站建设东莞|东莞网站制作||东莞网页设计|东莞网络公司|网站建设|网页设计|网络公司|网站制作|网站开发|东莞域名空间|东莞广告公司|东莞广告设计|网站建设东莞|东莞网站制作||东莞网页设计|东莞网络公司|网站建设|网页设计|网络公司|网站制作|网站开发|东莞域名空间|东莞广告公司|东莞广告设计|网站建设东莞|东莞网站制作||东莞网页设计|东莞网络公司|网站建设|网页设计|网络公司|网站制作|网站开发|东莞域名空间|东莞广告公司|东莞广告设计|网站建设东莞|东莞网站制作||东莞网页设计|东莞网络公司|网站建设|网页设计|网络公司|网站制作|网站开发|东莞域名空间|东莞广告公司|东莞广告设计|网站建设东莞|东莞网站制作|
域名注册 | 虚拟主机 | 网站建设 | 网站推广 | 广告设计 | 帮助中心 | 软件中心 | 关于腾达
东莞市腾达信息工程有限公司      本站网络实名: 东莞网站建设
地址:东莞市新城市中心区第一国际B座610   邮编:523007
电话:0769-22026071 22026072 传真:0769-22026076 24小时服务热线:13712032014
© 2002~2005 腾达网络   版权所有