📄 7.htm
字号:
<html>
<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>7</title>
</head>
<body>
<p align="center"><b><font size="5" color="#0078FF">
<span style="background-color: #CCCCCC">7. 指令码参考</span></font></b></p>
<div language="javascript" id="tab1" style="line-height: 25px; margin-left: 20px" ondragover="return tab1_ondragover()">
<font face="arial" color="#000000" size="2" style="line-height: 25px">
本章提供建构Active Server Pages(Asp)所需的参考,包括以下主题:</font><font face="arial" color="#000000" size="2" style="line-height: 25px"><ul style="line-height: 25px">
<li style="line-height: 25px">
<font face="arial" color="#3e80d7" size="2" style="line-height: 25px">
<b style="line-height: 25px"> JScript </b></font><br style="line-height: 25px">
</li>
<li style="line-height: 25px">
<font face="arial" color="#3e80d7" size="2" style="line-height: 25px">
<b style="line-height: 25px"> VBScript </b></font><br style="line-height: 25px">
</li>
<li style="line-height: 25px">
<font face="arial" color="#3e80d7" size="2" style="line-height: 25px">
<b style="line-height: 25px"> @ Directives </b></font><br style="line-height: 25px">
</li>
<li style="line-height: 25px">
<font face="arial" color="#3e80d7" size="2" style="line-height: 25px">
<b style="line-height: 25px"> Global.asa </b></font><br style="line-height: 25px">
</li>
</ul>
</font><a name="207001" style="line-height: 25px">
<p><font face="arial" color="#3e70d7" size="5" style="line-height: 25px">
<b style="line-height: 25px">JScript<br style="line-height: 25px">
</b></font></p>
<p><font face="arial" color="#000000" size="2" style="line-height: 25px">请参阅 </font></a><font face="arial" color="#000000" size="2" style="line-height: 25px"><a target="_new" href="http://msdn.microsoft.com/scripting" style="line-height: 25px">http://msdn.microsoft.com/scripting</a> 上的Jscript参考文件。</font></p>
<a name="207002" style="line-height: 25px">
<p><font face="arial" color="#3e70d7" size="5" style="line-height: 25px">
<b style="line-height: 25px">VBScript<br style="line-height: 25px">
</b></font></p>
<p><font face="arial" color="#000000" size="2" style="line-height: 25px">请参阅 </font></a><font face="arial" color="#000000" size="2" style="line-height: 25px"><a target="_new" href="http://msdn.microsoft.com/scripting" style="line-height: 25px">http://msdn.microsoft.com/scripting</a> 上的VBScript
Reference。</font></p>
<a name="207003" style="line-height: 25px">
<p><font face="arial" color="#3e70d7" size="5" style="line-height: 25px">
<b style="line-height: 25px">@ Directives<br style="line-height: 25px">
</b></font></p>
<p><font face="arial" color="#000000" size="2" style="line-height: 25px">
您可以在指令码中使用@处理指令来把关於如何处理 .asp档案的资讯传送给IIS 5.0。例如,下面的指令码使用了@
LANGUAGE来将指令码语言设定为VBScript:</font></p>
<div style="line-height: 25px; background-color: #d7d7d7">
<font face="Arial" size="3" style="line-height: 25px">
<pre style="line-height: 25px"><%@LANGUAGE=VBScript
Dim myvar
Application ("myvar") = This is my var
Response.Write (myvar)
%></pre>
</font>
</div>
<p><font face="arial" color="#000000" size="2" style="line-height: 25px">在IIS
5.0中,ASP支援以下五个@指令:</font></p>
<font face="arial" color="#000000" size="2" style="line-height: 25px">
<ul style="line-height: 25px">
<li style="line-height: 25px">@ CODEPAGE<br style="line-height: 25px">
</li>
<li style="line-height: 25px">@ ENABLESESSIONSTATE<br style="line-height: 25px">
</li>
<li style="line-height: 25px">@ LANGUAGE<br style="line-height: 25px">
</li>
<li style="line-height: 25px">@ LCID<br style="line-height: 25px">
</li>
<li style="line-height: 25px">@ TRANSACTION<br style="line-height: 25px">
</li>
</ul>
</font>
<p><font face="arial" color="#3e72d7" size="4" style="line-height: 25px">
<b style="line-height: 25px">@ CODEPAGE<br style="line-height: 25px">
</b></font></p>
<p><font face="arial" color="#000000" size="2" style="line-height: 25px">
您可以使用@ CODEPAGE指令来设定
.asp档案要用到的字码页。字码页是一个字元集,它可以包括数字、标点符号以及一些其他符号。不同的语言和环境可能会使用不同的字码页。例如,美式英语以及大多数欧洲语言使用ANSI字码页1252;日本汉字则使用OEM字码页932。</font></p>
<p><font face="arial" color="#000000" size="2" style="line-height: 25px">
字码页其实可以用一张关系表来表示,其中包含字元和单位元组或多位元组的对应关系。多数的字码页都是共用0x00-0x7F范围之间的ASCII字元集。</font></p>
<p><font face="arial" color="#000000" size="2" style="line-height: 25px">
您可以覆写已经被<font face="arial" color="#3e80d7" size="2" style="line-height: 25px"><b style="line-height: 25px"> Session.CodePage </b></font>属性及@
CODEPAGE指令设定过的字码页。但是,这样做只对在工作阶段范围内的指令码有效。</font></p>
<p><font face="arial" color="#3e76d7" size="2" style="line-height: 25px">
<b style="line-height: 25px">语法<br style="line-height: 25px">
</b></font></p>
<div style="line-height: 25px; background-color: #d7d7d7">
<font face="Arial" size="3" style="line-height: 25px">
<pre style="line-height: 25px"><%@ CODEPAGE = codepage % ></pre>
</font>
</div>
<p><font face="arial" color="#3e76d7" size="2" style="line-height: 25px">
<b style="line-height: 25px">参数<br style="line-height: 25px">
</b></font></p>
<p><font face="arial" color="#3e80d7" size="2" style="line-height: 25px">
<b style="line-height: 25px"> codepage </b></font></p>
<p><font face="arial" color="#000000" size="2" style="line-height: 25px">
一个不代表正负号的整数,它代表系统目前正在执行的ASP指令码引擎所用的有效字码页。</font></p>
<p><font face="arial" color="#3e76d7" size="2" style="line-height: 25px">
<b style="line-height: 25px">请参阅<br style="line-height: 25px">
</b></font></p>
<p><font face="arial" color="#000000" size="2" style="line-height: 25px">
<font face="arial" color="#3e80d7" size="2" style="line-height: 25px">
<b style="line-height: 25px"> Session.CodePage </b></font>。</font></p>
<p><font face="arial" color="#3e72d7" size="4" style="line-height: 25px">
<b style="line-height: 25px">@ ENABLESESSIONSTATE<br style="line-height: 25px">
</b></font></p>
<p><font face="arial" color="#000000" size="2" style="line-height: 25px">
您可以使用@ ENABLESESSIONSTATE指令来停掉对网页的工作追踪。工作追踪是用来维护与单一用户端发出请求相关的资讯。如果首页没有用到工作资讯,那麽停掉工作追踪可以减少IIS
5.0执行该指令码所必须的时间。</font></p>
<p><font face="arial" color="#3e76d7" size="2" style="line-height: 25px">
<b style="line-height: 25px">语法<br style="line-height: 25px">
</b></font></p>
<div style="line-height: 25px; background-color: #d7d7d7">
<font face="Arial" size="3" style="line-height: 25px">
<pre style="line-height: 25px"><%@ ENABLESESSIONSSTATE = True|False %></pre>
</font>
</div>
<p><font face="arial" color="#3e76d7" size="2" style="line-height: 25px">
<b style="line-height: 25px">注解<br style="line-height: 25px">
</b></font></p>
<p><font face="arial" color="#000000" size="2" style="line-height: 25px">
若需关於工作追踪的更多资讯,请参阅《Microsoft Internet Information Services
5.0超级管理手册—网站管理篇》第6章〈Active Server Pages〉中的〈管理工作阶段〉。</font></p>
<p><font face="arial" color="#3e72d7" size="4" style="line-height: 25px">
<b style="line-height: 25px">@ LANGUAGE<br style="line-height: 25px">
</b></font></p>
<p><font face="arial" color="#000000" size="2" style="line-height: 25px">
您可以使用@ LANGUAGE指令来设定解释指令码的语言。指令码语言可以设定为安装在IIS
5.0上的任何指令码引擎。预设指令码语言为VBScript,因此,如果指令码中没有@ LANGUAGE指令,那麽该指令码将由VBScript引擎来解译。</font></p>
<p><font face="arial" color="#3e76d7" size="2" style="line-height: 25px">
<b style="line-height: 25px">语法<br style="line-height: 25px">
</b></font></p>
<div style="line-height: 25px; background-color: #d7d7d7">
<font face="Arial" size="3" style="line-height: 25px">
<pre style="line-height: 25px"><%@ LANGUAGE = scriptengine %></pre>
</font>
</div>
<p><font face="arial" color="#3e76d7" size="2" style="line-height: 25px">
<b style="line-height: 25px">参数<br style="line-height: 25px">
</b></font></p>
<p><font face="arial" color="#3e80d7" size="2" style="line-height: 25px">
<b style="line-height: 25px"> scriptengine </b></font></p>
<p><font face="arial" color="#000000" size="2" style="line-height: 25px">
用来编译指令码的指令码引擎。IIS封装了两个指令码引擎,分别为VBScript和JScript。</font></p>
<p><font face="arial" color="#3e76d7" size="2" style="line-height: 25px">
<b style="line-height: 25px">注解<br style="line-height: 25px">
</b></font></p>
<p><font face="arial" color="#000000" size="2" style="line-height: 25px">您可以使用IIS
Admin Object<font face="arial" color="#3e80d7" size="2" style="line-height: 25px"><b style="line-height: 25px"> AspScriptLanguage </b></font>属性来改变预设指令码语言。该属性可应用於网路服务、网路伺服器、虚拟目录。若需更多资讯,请参阅《Microsoft
Internet Information Services 5.0超级管理手册—网站管理篇》第8章〈利用程式来管理IIS〉中的〈使用IIS
Admin物件〉。</font></p>
<p><font face="arial" color="#3e72d7" size="4" style="line-height: 25px">
<b style="line-height: 25px">@ LCID<br style="line-height: 25px">
</b></font></p>
<p><font face="arial" color="#000000" size="2" style="line-height: 25px">
您可以使用@ LCID指令来设定一个指令码的区域识别码。LCID是一个双位元组数(DWORD),它在低位元组中包含语言识别码,在高位元组中包含保留值。LCID提供的这个识别项是国际性、标准的缩写。该LCID内含要唯一辨识已安装系统定义地区所必须的元件。这里有两个预先确定的LCID值,LOCALE_SYSTEM_DEFAULT为系统预设地区,LOCALE_USER_DEFAULT是当前使用者的地区。</font></p>
<p><font face="arial" color="#3e76d7" size="2" style="line-height: 25px">
<b style="line-height: 25px">语法<br style="line-height: 25px">
</b></font></p>
<div style="line-height: 25px; background-color: #d7d7d7">
<font face="Arial" size="3" style="line-height: 25px">
<pre style="line-height: 25px"><%@ LCID = localeidentifier %></pre>
</font>
</div>
<p><font face="arial" color="#3e76d7" size="2" style="line-height: 25px">
<b style="line-height: 25px">参数<br style="line-height: 25px">
</b></font></p>
<p><font face="arial" color="#3e80d7" size="2" style="line-height: 25px">
<b style="line-height: 25px"> localeidentifier </b></font></p>
<p><font face="arial" color="#000000" size="2" style="line-height: 25px">
一个有效的区域识别码。</font></p>
<p><font face="arial" color="#3e76d7" size="2" style="line-height: 25px">
<b style="line-height: 25px">请参阅<br style="line-height: 25px">
</b></font></p>
<p><font face="arial" color="#000000" size="2" style="line-height: 25px">
Accommodating International Clients(在《Microsoft Internet Information Services
5.0超级管理手册—网站管理篇》第7章〈开发Web应用程式〉中)。</font></p>
<p><font face="arial" color="#3e72d7" size="4" style="line-height: 25px">
<b style="line-height: 25px">@ TRANSACTION<br style="line-height: 25px">
</b></font></p>
<p><font face="arial" color="#000000" size="2" style="line-height: 25px">
您可以使用@ TRANSACTION指令来指定目前的指令码要被视为是交易。如果一个指令码被视为是交易,Component
Services会建立一个交易来调整资源的更新。</font></p>
<p><font face="arial" color="#3e76d7" size="2" style="line-height: 25px">
<b style="line-height: 25px">语法<br style="line-height: 25px">
</b></font></p>
<div style="line-height: 25px; background-color: #d7d7d7">
<font face="Arial" size="3" style="line-height: 25px">
<pre style="line-height: 25px"><%@ TRANSACTION = value %></pre>
</font>
</div>
<p><font face="arial" color="#3e76d7" size="2" style="line-height: 25px">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -