时间发布ASP代码 [英] time release ASP code

查看:78
本文介绍了时间发布ASP代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我怎样才能让时间发布ASP代码?我希望在特定日期之后制作代码部分

可查看。这样做的东西,但这不是

工作正常:

if now()> =" 6/24/2005"然后

Response.Write(这里是我的新html)

else

Response.Write(现在只是显示当前信息)

结束如果

How can I made time released ASP code? I want to make section of code
viewable after a certain date. Something to this effect, but this does not
work right:
if now() >= "6/24/2005" then
Response.Write ( "here is my new html" )
else
Response.Write ( "for now just show the current information" )
end if

推荐答案

" Rusted" <无***** @ please.com>在留言中写道

新闻:Vr **************** @ fe04.usenetserver.com ...
"Rusted" <no*****@please.com> wrote in message
news:Vr****************@fe04.usenetserver.com...
我怎么能腾出时间发布ASP代码?我希望在特定日期之后可以查看部分代码。这样做的东西,但这确实无法正常工作:

if now()> =" 6/24/2005"然后
Response.Write(这里是我的新html)

Response.Write(现在只显示当前信息)
结束如果
How can I made time released ASP code? I want to make section of code
viewable after a certain date. Something to this effect, but this does
not work right:
if now() >= "6/24/2005" then
Response.Write ( "here is my new html" )
else
Response.Write ( "for now just show the current information" )
end if




日期文字应以#分隔。以下是参考资料:
http://msdn.microsoft.com/library/en...ndamentals.asp


请考虑使用ISO标准日期格式YYYYMMDD或YYYY-MM-DD。

这是一篇相关的文章:
http://aspfaq.com/show.asp?id=2260

Response.Write不返回值,因此不需要

拨打电话时的括号。



Date literals should be delimited with #. Here''s a reference:
http://msdn.microsoft.com/library/en...ndamentals.asp

Please consider using ISO standard date formats YYYYMMDD or YYYY-MM-DD.
Here''s a related article:
http://aspfaq.com/show.asp?id=2260

Response.Write does not return a value, so there is no need for the
parentheses when making the call.


" Rusted" <无***** @ please.com>在消息中写道

新闻:Vr **************** @ fe04.usenetserver.com ...

:怎么能我发布时间发布ASP代码?我想制作一段代码

:在特定日期之后可以查看。有这样的效果,但这确实

不是

:工作正确:





:if now()> =" 6/24/2005"然后

:Response.Write(这是我的新html)

:其他

:Response.Write(for now只显示当前信息)

:结束如果


由于这是在服务器端运行我不认为有必要使它成为ISO

标准。


这将做你想要的:


<%@ Language = VBScript%> ;

<%

选项明确

Response.Buffer = True


sub lprt( str)

Response.Write str& "< br />" &安培; vbCrLf

end sub


dim n,t

t =" 6/24/2005" ''目标日期

n = FormatDateTime(现在,vbShortDate)''现在 - 当前日期


如果n> = t则

lprt当前日期 &安培; n& "大于或等于: &安培; t $ / $
其他

lprt当前日期 &安培; n& "在之前 &安培; t

结束如果

%>

http://kiddanger.com/lab/timerelease.asp


-

罗兰大厅

/ *这些信息的分发是希望它有用,但

没有任何保证;甚至没有适销性的暗示保证

或特定用途的适用性。 * /

Technet脚本中心 - http:// www .microsoft.com / technet / scriptcenter /

WSH 5.6文档 - http://msdn.microsoft.com/downloads/list/webdev.asp

MSDN Library - http://msdn.microsoft.com/library/default.asp
"Rusted" <no*****@please.com> wrote in message
news:Vr****************@fe04.usenetserver.com...
: How can I made time released ASP code? I want to make section of code
: viewable after a certain date. Something to this effect, but this does
not
: work right:
:
:
: if now() >= "6/24/2005" then
: Response.Write ( "here is my new html" )
: else
: Response.Write ( "for now just show the current information" )
: end if

Since this is running server-side I don''t see a need to make it an ISO
standard.

This will do what you want:

<%@ Language=VBScript %>
<%
Option Explicit
Response.Buffer = True

sub lprt(str)
Response.Write str & "<br />" & vbCrLf
end sub

dim n, t
t = "6/24/2005" '' target date
n = FormatDateTime(now,vbShortDate) '' now - current date

if n >= t then
lprt "Current date " & n & " is greater than or equal to: " & t
else
lprt "Current date " & n & " is prior to " & t
end if
%>

http://kiddanger.com/lab/timerelease.asp

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp


Roland Hall于2005年6月5日在

microsoft.public.inetserver.asp.general写道:
Roland Hall wrote on 06 mei 2005 in
microsoft.public.inetserver.asp.general:
由于这是运行服务器端我不喜欢我们认为有必要使其成为ISO
标准。
Since this is running server-side I don''t see a need to make it an ISO
standard.




您在自己的网站上做的是符合您的口味。


您在此提供的建议应尽可能一般。


以下代码在00:00欧洲中部切换,

当服务器在加拿大多伦多当时:

<%

d =#2005-04-20 18:00#''21/4 / 05 00:00 CET

如果现在> d然后

%>

切换,< br>你太迟了!

<%else%>

尚未,< br>朋友!

<%end if if> < br $>
-

Evertjan。

荷兰。

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



What you do on your own site is for your taste.

What you advise here should be as general as possible.

The below code switched at 00:00 Central European,
while the server is in Toronto, Canada and on that time:
<%
d = #2005-04-20 18:00# '' 21/4/05 00:00 CET
if now>d then
%>
Switched,<br>you''re too late!
<% else %>
Not yet,<br>friend!
<% end if %>
--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)


这篇关于时间发布ASP代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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