ASP常见问题及解答(1)
1.如何 最小化、最大化、关闭窗口答:<objectid=hh1classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">
<paramname="command"value="minimize"></object>
<objectid=hh2classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">
<paramname="command"value="maximize"></object>
<objectid=hh3classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">
<paramname="command"value="close"></object>
<inputtype=buttonvalue=最小化onclick=hh1.click()>
<inputtype=buttonvalue=最大化onclick=hh2.click()>
<inputtype=buttonvalue=关闭onclick=hh3.click()>
2.如何静止页面缓存
答:htm网页
<metahttp-equiv="pragma"content="no-cache">
<metahttp-equiv="cache-control"content="no-cache,must-revalidate">
<metahttp-equiv="expires"content="wed,26feb199708:21:57gmt">
或者<metahttp-equiv="expires"content="0">
asp网页
response.expires=-1
response.expiresabsolute=now()-1
response.cachecontrol="no-cache"
php网页
header("expires:mon,26jul199705:00:00gmt");
header("cache-control:no-cache,must-revalidate");
header("pragma:no-cache");
3.如何检查一段字符串是否全由数字组成
<scriptlanguage="javascript"><!--
functionchecknum(str){returnstr.match(/d/)==null}
alert(checknum("1232142141"))
alert(checknum("123214214a1"))
//--></script>
4.如何获取机器信息
答本机ip<%=request.servervariables("remote_addr")%>
服务器名<%=request.servervariables("server_name")%>
服务器ip<%=request.servervariables("local_addr")%>
服务器端口<%=request.servervariables("server_port")%>
补充:asp教程,技巧与性能优化