asp向服务器请求源码(在asp中,服务器响应用户请求)
本文目录一览:
asp客户端如何请求服务端的数据
可以。AJAX就是干这个的!
ASP代码本身是不能实现定时功能的(你一定要用ASP的代码的话,写出来的是个死循环。。。),只能借助脚本了。
去看下AJAX的网页应用,保证能满足你的需求。
ASP获取服务器及本地信息 代码如何编写
html
head
link href="../css.css" rel="stylesheet" type="text/css"
/head
body
table width="50%" border="0" align="center" cellpadding="0" cellspacing="0"
tr
td
table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#336699"
tr bgcolor="" align="center"
td height="20" colspan="2" class="6c27-a00b-e144-f8bc htd" font color="#FFFFFF"b服 务 器 asp向服务器请求源码的 配 置/b/font/td
/tr
tr
td width="40%" align="center" bgcolor="#336699" class="a00b-e144-f8bc-c704 htd"font color="#FFFFFF"检取ISAPIDLL的metabase路径/font/td
td align="center" bgcolor="#3366CC" class="e144-f8bc-c704-6c1d htd"font color="#FFf000"%=Request.ServerVariables("APPL_MD_PATH")%/font/td
/tr
tr
td width="40%" align="center" bgcolor="#336699" class="f8bc-c704-6c1d-7995 htd"font color="#FFFFFF"路径信息/font/td
td align="center" bgcolor="#3366CC" class="c704-6c1d-7995-0a55 htd"font color="#FFf000"%=Request.ServerVariables("PATH_INFO")%/font/td
/tr
tr
td width="40%" align="center" bgcolor="#336699" class="6c1d-7995-0a55-3355 htd"font color="#FFFFFF"服务器IP地址/font/td
td align="center" bgcolor="#3366CC" class="7995-0a55-3355-bf0e htd"font color="#FFf000"%=Request.ServerVariables("LOCAL_ADDR")%/font/td
/tr
tr
td width="40%" align="center" bgcolor="#336699" class="0a55-3355-bf0e-52a7 htd"font color="#FFFFFF"显示执行SCRIPT的虚拟路径/font/td
td align="center" bgcolor="#3366CC" class="3355-bf0e-52a7-ff4e htd"font color="#FFf000"%=Request.ServerVariables("SCRIPT_NAME")%/font/td
/tr
tr
td width="40%" align="center" bgcolor="#336699" class="bf0e-52a7-ff4e-158f htd"font color="#FFFFFF"返回服务器的主机名asp向服务器请求源码,DNS别名asp向服务器请求源码,或IP地址/font/td
td align="center" bgcolor="#3366CC" class="52a7-ff4e-158f-7504 htd"font color="#FFf000"%=Request.ServerVariables("SERVER_NAME")%/font/td
/tr
tr
td width="40%" align="center" bgcolor="#336699" class="97be-c01f-5ce3-b19e htd"font color="#FFFFFF"返回服务器处理请求的端口/font/td
td align="center" bgcolor="#3366CC" class="c01f-5ce3-b19e-6c27 htd"font color="#FFf000"%=Request.ServerVariables("SERVER_PORT")%/font/td
/tr
tr
td width="40%" align="center" bgcolor="#336699" class="5ce3-b19e-6c27-a00b htd"font color="#FFFFFF"协议的名称和版本/font/td
td align="center" bgcolor="#3366CC" class="b19e-6c27-a00b-e144 htd"font color="#FFf000"%=Request.ServerVariables("SERVER_PROTOCOL")%/font/td
/tr
tr
td width="40%" align="center" bgcolor="#336699" class="6c27-a00b-e144-f8bc htd"font color="#FFFFFF"服务器的名称和版本/font/td
td align="center" bgcolor="#3366CC" class="a00b-e144-f8bc-c704 htd"font color="#FFf000"%=Request.ServerVariables("SERVER_SOFTWARE")%/font/td
/tr
tr
td width="40%" align="center" bgcolor="#336699" class="e144-f8bc-c704-6c1d htd"font color="#FFFFFF"服务器操作系统内核/font/td
td align="center" bgcolor="#3366CC" class="f8bc-c704-6c1d-7995 htd"font color="#FFf000"%=Request.ServerVariables("OS")%/font/td
/tr
tr
td width="40%" align="center" bgcolor="#336699" class="c704-6c1d-7995-0a55 htd"font color="#FFFFFF"脚本超时时间/font/td
td align="center" bgcolor="#3366CC" class="6c1d-7995-0a55-3355 htd"font color="#FFf000"%=Server.ScriptTimeout% 秒/font/td
/tr
tr
td width="40%" align="center" bgcolor="#336699" class="7995-0a55-3355-bf0e htd"font color="#FFFFFF"服务器CPU数量/font/td
td align="center" bgcolor="#3366CC" class="0a55-3355-bf0e-52a7 htd"font color="#FFf000"%=Request.ServerVariables("NUMBER_OF_PROCESSORS")% 个/font/td
/tr
tr
td width="40%" align="center" bgcolor="#336699" class="3355-bf0e-52a7-ff4e htd"font color="#FFFFFF"服务器解译引擎/font/td
td align="center" bgcolor="#3366CC" class="bf0e-52a7-ff4e-158f htd"font color="#FFf000"%=ScriptEngine "/" ScriptEngineMajorVersion "."ScriptEngineMinorVersion"." ScriptEngineBuildVersion %/font/td
/tr
/table
table width="100%" border="0" align="center" cellpadding="0" cellspacing="0"
tr
td height="20" colspan="2" align="center"
/td
/tr
tr
td height="20" colspan="2" class="52a7-ff4e-158f-7504 htd" align="center" bgcolor="#336699"
font color="#FFFFFF"b浏 览 器 信 息/b/font
/td
/tr
tr
td height="20" colspan="2" align="center" bgcolor="#336699"
%set browscap=server.createobject("mswc.browsertype")%
table width="100%" border="0" align="center" cellpadding="0" cellspacing="0"
trtd width="40%" align="center" class="97be-c01f-5ce3-b19e htd"font color="#FFFFFF"浏览器类型/font/td
td align="center" bgcolor="#3366CC" class="c01f-5ce3-b19e-6c27 htd"font color="#FFf000"%=browscap.browser%/font/td/tr
trtd width="40%" align="center" class="5ce3-b19e-6c27-a00b htd"font color="#FFFFFF"浏览器版本/font/td
td align="center" bgcolor="#3366CC" class="b19e-6c27-a00b-e144 htd"font color="#FFf000"%=browscap.version%/font/td/tr
trtd width="40%" align="center" class="6c27-a00b-e144-f8bc htd"font color="#FFFFFF"是否支持表格/font/td
td align="center" bgcolor="#3366CC" class="a00b-e144-f8bc-c704 htd"font color="#FFf000"%=browscap.tables%/font/td/tr
trtd width="40%" align="center" class="e144-f8bc-c704-6c1d htd"font color="#FFFFFF"是否支持ActiveX控件/font/td
td align="center" bgcolor="#3366CC" class="f8bc-c704-6c1d-7995 htd"font color="#FFf000"%=browscap.activexcontrols%/font/td/tr
trtd width="40%" align="center" class="c704-6c1d-7995-0a55 htd"font color="#FFFFFF"是否支持JavaApplets/font/td
td align="center" bgcolor="#3366CC" class="6c1d-7995-0a55-3355 htd"font color="#FFf000"%=browscap.javaapplets%/font/td/tr
trtd width="40%" align="center" class="7995-0a55-3355-bf0e htd"font color="#FFFFFF"是否支持Javascript/font/td
td align="center" bgcolor="#3366CC" class="0a55-3355-bf0e-52a7 htd"font color="#FFf000"%=browscap.javascript%/font/td/tr
trtd width="40%" align="center" class="3355-bf0e-52a7-ff4e htd"font color="#FFFFFF"是否支持Cookies/font/td
td align="center" bgcolor="#3366CC" class="bf0e-52a7-ff4e-158f htd"font color="#FFf000"%=browscap.cookies%/font/td/tr
trtd width="40%" align="center" class="52a7-ff4e-158f-7504 htd"font color="#FFFFFF"是否支持框架/font/td
td align="center" bgcolor="#3366CC" class="97be-c01f-5ce3-b19e htd"font color="#FFf000"%=browscap.frames%/font/td/tr
trtd width="40%" align="center" class="c01f-5ce3-b19e-6c27 htd"font color="#FFFFFF"是否支持VBScript/font/td
td align="center" bgcolor="#3366CC" class="5ce3-b19e-6c27-a00b htd"font color="#FFf000"%=browscap.vbscript%/font/td/tr
/table
%set browscap=nothing%
/td
/tr
/table
table width="100%" border="0" align="center" cellpadding="0" cellspacing="0"
tr
td height="20" colspan="2" align="center"
/td
/tr
tr
td height="20" colspan="2" class="b19e-6c27-a00b-e144 htd" align="center" bgcolor="#336699"
font color="#FFFFFF"b磁 盘 驱 动 器 信 息/b/font
/td
/tr
tr
td height="20" colspan="2"
%
function tran(driver)
select case driver
case 0:tran="设备无法识别"
case 1:tran="软盘驱动器"
case 2:tran="硬盘驱动器"
case 3:tran="网络硬盘驱动器"
case 4:tran="光盘驱动器"
case 5:tran="RAM虚拟磁盘"
end select
end function
set fso=server.createobject("scripting.filesystemobject")
%
table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#336699"
trtd class="6c27-a00b-e144-f8bc htd" align="center"font color="#FFFFFF"盘符/font/tdtd class="a00b-e144-f8bc-c704 htd" align="center"font color="#FFFFFF"类型/font/tdtd class="e144-f8bc-c704-6c1d htd" align="center"font color="#FFFFFF"卷标/font/td
td class="f8bc-c704-6c1d-7995 htd" align="center"font color="#FFFFFF" 总计大小/font/tdtd class="c704-6c1d-7995-0a55 htd" align="center"font color="#FFFFFF"可用空间/font/tdtd class="6c1d-7995-0a55-3355 htd" align="center"font color="#FFFFFF"文件系统/font/td
td class="7995-0a55-3355-bf0e htd" align="center"font color="#FFFFFF"序列号/font/tdtd class="0a55-3355-bf0e-52a7 htd" align="center"font color="#FFFFFF"是否可用/font/tdtd class="3355-bf0e-52a7-ff4e htd" align="center"font color="#FFFFFF"路径/font/td
/tr
%
for each drv in fso.drives
response.write"tr"
response.write"td class=htd align=center bgcolor=#3366CCfont color=#FFf000" drv.driveletter "/font/td"
response.write"td class=htd align=center bgcolor=#3366CCfont color=#FFf000" tran(drv.drivetype) "/font/td"
response.write"td class=htd align=center bgcolor=#3366CCfont color=#FFf000" drv.volumename "/font/td"
response.write"td class=htd align=center bgcolor=#3366CCfont color=#FFf000" formatnumber(drv.totalsize/1024,0) "/font/td"
response.write"td class=htd align=center bgcolor=#3366CCfont color=#FFf000" formatnumber(drv.availablespace/1024,0) "/font/td"
response.write"td class=htd align=center bgcolor=#3366CCfont color=#FFf000" drv.filesystem "/font/td"
response.write"td class=htd align=center bgcolor=#3366CCfont color=#FFf000" drv.serialnumber "/font/td"
response.write"td class=htd align=center bgcolor=#3366CCfont color=#FFf000" drv.isready "/font/td"
response.write"td class=htd align=center bgcolor=#3366CCfont color=#FFf000" drv.path "/font/td"
next
%
/table
/td
/tr
/table
/td
/tr
/table
/body
/html
ASP中浏览器如何主动向服务器请求数据呢?
在script中,settimeout一段时候后请求一个专门的页面来判断session。
ASP代码是如何工作的?
用户在地址栏中请求一个asp程序。
浏览器向ASP服务器请求这个asp程序,而不是像html一样直接处理一个自身的html程序,不需要在服务器上的运行。
ASP程序中的服务器端脚本开始运行。
ASP程序连续的执行这个请求文件中的所有语句,然后生成一个HTML文件。
结果是,100%的纯HTML代码发送到客户端,所以我们在客户端看到的代码还是HTML,并不是ASP的源代码。这样做,就可以很少地考虑IE和Netscape 之间的区别了,而且我们也不怕别人看到我们的源代码!不过,我们只是不能看到ASP的源程序而已