请教关于ASP中写Http头的问题

因为最近需要使用服务器push的功能,但里面牵涉到自定义的http头,而且我看的大多数是CGI的脚本,不知使用ASP是否能直接写HTTP头以实现以下的push功能?
例:
echo "HTTP/1.1 200"
echo "Content-type: multipart/x-mixed-replace;boundary=--ThisRandomString--"
echo ""
echo "--ThisRandomString--"
while true
do
echo "Content-type: text/html"
echo ""
echo "h2Processes on this machine updated every 5 seconds/h2"
echo "time:"
date
echo "p"
echo "plaintext"
ps -el
echo "--ThisRandomString--"
sleep 5
done

---------------------------------------------------------------

http://www.6to23.com/s11/s11d6/200181394015.htm
http://www.6to23.com/s11/s11d6/200181394557.htm
http://www.6to23.com/s11/s11d6/200181394435.htm
---------------------------------------------------------------

HTTP头的输出用
Response.AddHeader
比如:
Response.AddHeader "Content-type","text/html"
---------------------------------------------------------------

不知道是不是ie6不支持push
我做出如下一个ASP来,但是没有正常执行。

 1   
 2response.Status="200 OK"   
 3response.Contenttype="multipart/x-mixed-replace; boundary=""--ThisRandomString"""   
 4  
 5do   
 6response.write "--ThisRandomString" &vbCRlf   
 7response.write "Content-type: text/html" &vbCRlf &vbCRlf   
 8response.write "Processes on this machine updated every 5 seconds" &vbCRlf   
 9response.write "time:"   
10response.write date &vbCRlf   
11response.write vbCRlf   
12  
13response.flush   
14start=timer   
15do:loop while timer<=start+5   
16  
17loop while true   

---------------------------------------------------------------

是的,IE6不再支持push了。
---------------------------------------------------------------

哎~~

Published At
Categories with Web编程
comments powered by Disqus