⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 7.htm

📁 IIS5.0超级管理手册-网页开发篇 书籍语言: 简体中文 书籍类型: 网页设计 授权方式: 免费软件 书籍大小: 262 KB
💻 HTM
📖 第 1 页 / 共 4 页
字号:
  <p><font face="arial" color="#3e80d7" size="2" style="line-height: 25px">
  <b style="line-height: 25px">&nbsp;ProgID&nbsp;</b></font></p>
  <p><font face="arial" color="#000000" size="2" style="line-height: 25px">
  与一个类别识别项相关联的识别项。ProgID或者ClassID必须在 &lt;OBJECT&gt; 标记中定义。ProgID的格式为 [Vendor.] 
  Component.[Version]。</font></p>
  <p><font face="arial" color="#3e80d7" size="2" style="line-height: 25px">
  <b style="line-height: 25px">&nbsp;CalssID&nbsp;</b></font></p>
  <p><font face="arial" color="#000000" size="2" style="line-height: 25px">
  用於为COM物件指定一个唯一的识别项。ProgID或者ClassID必须在 &lt;OBJECT&gt; 标记中定义。</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">
  下面的第一个范例使用ProgID参数建立一个Session范围名为MyConnection的物件。第二个范例则是使用ClassID参数。</font></p>
  <div style="line-height: 25px; background-color: #d7d7d7">
    <font face="Arial" size="3" style="line-height: 25px">
    <pre style="line-height: 25px">&lt; OBJECT RUNAT=Server SCOPE=Session ID=MyConnection
PROGID= &quot;ADODB.Connection&quot;&gt;
REM Object Script
&lt;/ OBJECT &gt;

&lt; OBJECT RUNAT=Server SCOPE=Session ID=MyConnection
CLASSID=&quot;Clsid:8AD3067A-B3FC-11CF-A560-00A0C9081C21&quot; &gt;
REM Object Script
&lt;/ OBJECT &gt;</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">
  Global.asa档案中宣告的物件可以被应用程式中的任何指令码使用。例如,如果宣告了以下物件:</font></p>
  <div style="line-height: 25px; background-color: #d7d7d7">
    <font face="Arial" size="3" style="line-height: 25px">
    <pre style="line-height: 25px">--GLOBAL.ASA--

&lt; OBJECT RUNAT=Server SCOPE=Session ID=MyAd PROGID=&quot;MSWC.AdRotator&quot;&gt;
&lt;/ OBJECT &gt;</pre>
    </font>
  </div>
  <p><font face="arial" color="#000000" size="2" style="line-height: 25px">
  那麽你就可以从该应用程式中的任何网页来存取MyAd物件</font></p>
  <div style="line-height: 25px; background-color: #d7d7d7">
    <font face="Arial" size="3" style="line-height: 25px">
    <pre style="line-height: 25px">--SOME .asp --

&lt;%= MyAd.GetAdvertisement(&quot;ads/adrot.txt&quot;) %&gt;</pre>
    </font>
  </div>
  <p><font face="arial" color="#3e72d7" size="4" style="line-height: 25px">
  <b style="line-height: 25px">TypeLibrary宣告<br style="line-height: 25px">
 </b></font></p>
  <p><font face="arial" color="#000000" size="2" style="line-height: 25px">
  型别程式库是一个档案,它包含有关於COM元件所支援之物件和类型的资讯。通常,COM元件会在型别程式库中描述它所支援的常数。如果您的Web应用程式依赖於在型别程式库中宣告了资料类型的COM物件,那麽您可以在Global.asa档案中宣告该型别程式库。这样做将使应用程式中的任何指令码可以使用在型别程式库中宣告的常数。</font></p>
  <p><font face="arial" color="#000000" size="2" style="line-height: 25px">
  有关在ASP中使用常数的更多资讯,请参阅《Microsoft Internet Information Services 
  5.0超级管理手册—网站管理篇》第6章〈Active Server Pages〉中的〈使用变数和常数〉。</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">&lt;!--METADATA TYPE =&quot;TypeLib&quot;
 FILE =&quot;file&quot;
 UUID =&quot;typelibraryuuid&quot;
 VERSION =&quot;majorversionnumber.minorversionnumber&quot;
 LCID =&quot;localeid&quot;
--&gt;</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">&nbsp;file&nbsp;</b></font></p>
  <p><font face="arial" color="#000000" size="2" style="line-height: 25px">
  指向型别程式库的绝对路径。如果同时提供了此参数和typelibraryuuid参数的话,那麽这个参数将用来识别型别程式库。file参数或typelibraryuuid参数必须择其一。</font></p>
  <p><font face="arial" color="#3e80d7" size="2" style="line-height: 25px">
  <b style="line-height: 25px">&nbsp;typelibraryuuid&nbsp;</b></font></p>
  <p><font face="arial" color="#000000" size="2" style="line-height: 25px">
  通用型别程式库的唯一识别项,file参数或typelibraryuuid参数必须择其一。</font></p>
  <p><font face="arial" color="#3e80d7" size="2" style="line-height: 25px">
  <b style="line-height: 25px">&nbsp;majorversionnumber&nbsp;</b></font></p>
  <p><font face="arial" color="#000000" size="2" style="line-height: 25px">
  用来选择版本。如果请求的版本未找到,将使用最近用过的版本(选择性的)。</font></p>
  <p><font face="arial" color="#3e80d7" size="2" style="line-height: 25px">
  <b style="line-height: 25px">&nbsp;Minorversionnumber&nbsp;</b></font></p>
  <p><font face="arial" color="#000000" size="2" style="line-height: 25px">
  用来选择版本。如果请求的版本未找到,将使用最近用过的版本(选择性的)。</font></p>
  <p><font face="arial" color="#3e80d7" size="2" style="line-height: 25px">
  <b style="line-height: 25px">&nbsp;localeid&nbsp;</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">
  伺服器可以传回以下错误资讯:</font></p>
  <center style="line-height: 25px">
  <table border="1" style="line-height: 25px">
    <tbody style="line-height: 25px">
      <tr style="line-height: 25px">
        <th style="line-height: 25px"><font size="2" style="line-height: 25px">
        错误值</font> </th>
        <th style="line-height: 25px"><font size="2" style="line-height: 25px">
        说明</font></th>
      </tr>
      <tr style="line-height: 25px">
        <td style="line-height: 25px"><font size="2" style="line-height: 25px">
        ASP 0222</font></td>
        <td style="line-height: 25px"><font size="2" style="line-height: 25px">
        无效的型别程式库规格。METADATA标记中包含了一个无效型别程式库规格。</font></td>
      </tr>
      <tr style="line-height: 25px">
        <td style="line-height: 25px"><font size="2" style="line-height: 25px">
        ASP 0223</font></td>
        <td style="line-height: 25px"><font size="2" style="line-height: 25px">
        找不到型别程式库。METADATA标记中包含了一个无法和登录项目(Register entry)符合的型别程式库规格。</font></td>
      </tr>
      <tr style="line-height: 25px">
        <td style="line-height: 25px"><font size="2" style="line-height: 25px">
        ASP 0224</font></td>
        <td style="line-height: 25px"><font size="2" style="line-height: 25px">
        无法载入型别程式库。ASP无法载入METADATA标记中指定的型别程式库。</font></td>
      </tr>
      <tr style="line-height: 25px">
        <td style="line-height: 25px"><font size="2" style="line-height: 25px">
        ASP 0225</font></td>
        <td style="line-height: 25px"><font size="2" style="line-height: 25px">
        无法包装型别程式库。ASP无法从METADATA标记中指定的型别程式库建立一个<font face="arial" color="#3e80d7" size="2" style="line-height: 25px"><b style="line-height: 25px">&nbsp;Type 
        Library Wrapper&nbsp;</b></font>物件。</font></td>
      </tr>
  </table>
  </center>
  <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">
  METADATA标记最好能够出现在Global.asa档案的开头。不过,不论是包括在SCRIPT内或外部的标记,都可以出现在Global.asa档案中的任何地方。</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">&nbsp;ADODB.AdErrItemNotFound&nbsp;</b></font>就比<font face="arial" color="#3e80d7" size="2" style="line-height: 25px"><b style="line-height: 25px">&nbsp;adErrItemNotFound&nbsp;</b></font>更为清楚。</font></p>
  <p><font face="arial" color="#000000" size="2" style="line-height: 25px">
  如果您使用Microsoft Visual 
  InterDev建立Global.asa档案,那麽METADATA标记将包括可选择的STARTSPAN和ENDSPAN关键字,不过这些关键字会被IIS 
  忽略掉。</font></p>
  <p><font face="arial" color="#000000" size="2" style="line-height: 25px">
  如果您没有为型别程式库指定一个区域识别项,那麽将会使用系统的预设区域识别项。如果系统的区域识别项也无法使用,那麽该型别程式库的区域识别项将设定为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>
  <p><font face="arial" color="#000000" size="2" style="line-height: 25px">
  下面范例中的MyComponent是用Visual Basic 5.0开发的。MyComponent用以下的语法定义了常数MyError:</font></p>
  <div style="line-height: 25px; background-color: #d7d7d7">
    <font face="Arial" size="3" style="line-height: 25px">
    <pre style="line-height: 25px">Public Const MyError = &quot;You are not using MyComponent correctly.&quot;</pre>
    </font>
  </div>
  <p><font face="arial" color="#000000" size="2" style="line-height: 25px">
  型别程式库包含在mycomponent.lib中,该档案位於以下目录:</font></p>
  <div style="line-height: 25px; background-color: #d7d7d7">
    <font face="Arial" size="3" style="line-height: 25px">
    <pre style="line-height: 25px">C:\MyComponent</pre>
    </font>
  </div>
  <p><font face="arial" color="#000000" size="2" style="line-height: 25px">
  下面的METADATA标记包含在MyApp应用程式的Global.asa档案内。</font></p>
  <div style="line-height: 25px; background-color: #d7d7d7">
    <font face="Arial" size="3" style="line-height: 25px">
    <pre style="line-height: 25px">&lt;!-- ETADATA TYPE= &quot;Type Lib&quot;
FILE=&quot;MyComponent.tlb &quot;
--&gt;</pre>
    </font>
  </div>
  <p><font face="arial" color="#000000" size="2" style="line-height: 25px">
  现在,MyApp应用程式中的任何 .asp档案都可以包含以下指令码:</font></p>
  <div style="line-height: 25px; background-color: #d7d7d7">
    <font face="Arial" size="3" style="line-height: 25px">
    <pre style="line-height: 25px">&lt;%
   Dim MyVar
   Set MyVar = Server.CreateObject (&quot;MyComponent.MyClass&quot;)
   Currentreturn = MyVar.MyMethod
   If Currentreturn = False
     Response.Write ( MyError )
   End If
%&gt;
</pre>
  </div>
  </font></a>
</div>

</body>

</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -