Byshawl.qiu
summary:
This article demonstrates several important applications of ASP server-side scripts.
Table of contents:
1.Transfer the collection/object
1.1VBScript traversal form collection
1.2 JScript traversal form collection
2. Transform the value of the variable into a variable and assign a value
2.1VBScript transforms the variable value into a variable and assigns a value
2.2JScript converts the variable value to a variable and assigns a value
3. Dynamically include files
3.1VBScript dynamically included files
3.2JScript dynamically includes files
shawl.qiu
2006-10-11
http://blog.csdn.net/btbtd
1.Transfer the collection/object
1.1VBScript traversal form collection
linenum
<%
foreachtempinrequest.Form
response.writetemp&":"&request.form(temp)
next
%>
1.2 JScript traversal form collection
linenum
<%
for(var$e=newEnumerator(Request.Form);!$e.atEnd();$e.moveNext()){
Response.Write($e.item()+':<br/>'+Request.Form($e.item()));
}
%>
2. Transform the value of the variable into a variable and assign a value
2.1VBScript transforms the variable value into a variable and assigns a value
linenum
<%
foreachtempinrequest.Form
executetemp&"=request.form(temp)"
next
%>
2.2JScript converts the variable value to a variable and assigns a value
linenum
<%
var$xml=newActiveXObject("microsoft.xmldom");
$xml.load(Server.MapPath('config.xml'));
var$childNodes=$xml.documentElement.selectSingleNode('//siteconfig').childNodes
for($e=newEnumerator($childNodes);!$e.atEnd();$e.moveNext()){
eval($e.item().nodeName+"=$e.item().text");
}
$xml=null;
Response.Write(sitekeywords);
%>
3. Dynamically include files
3.1VBScript dynamically included files
linenum
<%
functionfInclude(filepath)
'samplecall'''///executefInclude("include/system/language/"&sitefglang&"/main.asp")///'''
dimcnt
cnt=CreateObject("scripting.fileSystemObject").openTextFile(server.MapPath(filepath)).readall