global.asa中的常量 [英] constants in global.asa

查看:65
本文介绍了global.asa中的常量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试通过在global.asa中创建

常量(Const)来创建只读全局变量,但我似乎无法引用它们。

将它们粘贴在一个包含的工作正常,但似乎更具结构性

声音使用Application_OnStart。我是否尝试过不可能的事情,如果是这样的话,那么这是什么?

I''ve been trying to create read-only global variables by creating
constants (Const) in my global.asa, but I can''t seem to reference them.
Sticking them in an include works fine, but it seems more structurally
sound to use Application_OnStart. Am I attempting the impossible, and
if so, why?

推荐答案

2obvious在04二月写的2005年在microsoft.public.inetserver.asp.general:
2obvious wrote on 04 feb 2005 in microsoft.public.inetserver.asp.general:
我一直在尝试通过在全局创建
常量(Const)来创建只读全局变量.asa,但我似乎无法引用它们。
将它们粘贴在一个包含的工作正常,但在使用Application_OnStart时似乎更具结构性。我是否尝试过不可能,如果是这样,为什么?
I''ve been trying to create read-only global variables by creating
constants (Const) in my global.asa, but I can''t seem to reference them.
Sticking them in an include works fine, but it seems more structurally
sound to use Application_OnStart. Am I attempting the impossible, and
if so, why?




使用应用程序变量。


常量是vbscript [或其他脚本]并随页面消亡。


-

Evertjan。

荷兰。

(用我的电子邮件地址替换所有带点的十字架)



Use application variables.

Constants are vbscript [or other script] and die with the page.

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)


在global.asa中使用公共声明怎么样? (呃,可以

你使用带有常量的公共声明 - 不是Const声明

?)从我读到的,Public不能使用在一个程序中,

所以我必须将它放在Application_OnStart之外,但它会在$ global.asa中继续... b / b
What about using the Public declaration in the global.asa? (uh, Can
you use a Public declaration with a constant--isn''t Const a declaration
as well?) From what I read, Public cannot be used within a procedure,
so I would have to put it outside Application_OnStart, but it would
still be in the global.asa...


AFAIK你可以声明对象而不是VBScript常量..


我的个人喜好是在我的所有ASP页面中包含一个文件

包含在tunrs中包含最常用的东西,如常量,

UI实用程序,数据库访问等...

在每一页我可能包含更多有特殊需求的文件。


这样我通常只需关心一个包含文件......


Patrice

-


" 2obvious" < VA ******** @ hotmail.com>一个écritdansle message de

news:11 ********************* @ o13g2000cwo.googlegro ups.com ...
AFAIK you can declare objects but not VBScript constants..

My personal preference is to include a single file in all my ASP Pages that
contains in tunrs includes the most frequently used stuff such as constants,
UI utilities, database access etc...
In each page I can include sometimes more files with very specialized needs.

This way I generally just have to care about a single include file...

Patrice
--

"2obvious" <va********@hotmail.com> a écrit dans le message de
news:11*********************@o13g2000cwo.googlegro ups.com...
我一直在尝试通过在global.asa中创建
常量(Const)来创建只读全局变量,但我似乎无法引用它们。
将它们粘贴在include中可以正常工作,但使用Application_OnStart似乎更具结构性。我是否尝试过不可能的事情,如果是这样,为什么?
I''ve been trying to create read-only global variables by creating
constants (Const) in my global.asa, but I can''t seem to reference them.
Sticking them in an include works fine, but it seems more structurally
sound to use Application_OnStart. Am I attempting the impossible, and
if so, why?



这篇关于global.asa中的常量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆