替代的Server.CreateObject
-
25-09-2019 - |
题
我写在传统的ASP导航系统(在Windows CE)。 我需要一种动态包括基于呼叫脚本导航文件。 我已经想出用下面的代码,其包括nav.inc位于主叫脚本的文件夹,以允许不同的文件夹具有不同的导航功能英寸
此作品在我的Windows的测试机上正常,但不是当我部署到Windows CE。码和误差如下所示。如果任何人都可以提供周围的工作或将是巨大的任何反馈。感谢
代码:
<%
'Get path name
Dim i
fullname = Request.ServerVariables("SCRIPT_NAME")
my_array=split(fullname,"/")
fname=my_array(ubound(my_array))
fname = ""
For i = 0 to ubound(my_array) - 1
fname = fname & my_array(i) & "/"
Next
fname = fname & "nav.inc"
Set fs=Server.CreateObject("Scripting.FileSystemObject")
If (fs.FileExists(Server.MapPath(fname)))=true Then
Server.Execute(fname)
End If
%>
错误:
Microsoft VBScript运行时错误: '800A01B6'
描述:对象不支持 此属性或方法: '的Server.CreateObject'
如果我更改代码,只是说Set fs=CreateObject("Scripting.FileSystemObject")
我收到以下错误:
Microsoft VBScript运行时错误: '800a01ad'
描述:ActiveX组件不能 创建对象: 'Scripting.FileSystemObject的'
更新我刚才想直接运行使用Server.Execute这也失败。它看起来像我没有给服务对象的任何访问。有没有解决有关此呢?
解决方案
CreateObject
和Execute
不是在Windows CE支持。结果
是不是也支持<OBJECT>
标签,这样,你的运气了,对不起。
Server Object Implementation
---------------------------
The Server object provides access to methods and properties on the server.
Most of these methods and properties serve as utility functions.
Server method Windows CE implementation
-----------------------------------------
CreateObject Not supported
Execute Not supported
GetLastError Not supported
HTMLEncode Not supported
MapPath Fully supported
ScriptTimeout Not supported
Transfer Not supported
URLEncode Fully supported
不隶属于 StackOverflow