Overview:
The Server Object has seven (7) Methods, one (1) Property, zero (0) Events, and zero (0) Collections.
List of Methods:
Create an instance of an Object Execute( ) Server.Execute("fileName.asp")
Executes an outside file (effect is similar to SSI) GetLastError( ) Server.GetLastError()
Returns location and description of the last ASP error HTMLEncode( ) Server.HTMLEncode("some String")
Encodes string to HTML characters MapPath( ) Server.MapPath("\\virtualFolder")
Converts virtual path to physical path Transfer( ) Server.Transfer("fileName.asp")
Transfers execution out of one page and into another URLEncode( ) Server.URLEncode("some String")
Encodes string to URL standards
Below is the script for Lesson 14.
<%@LANGUAGE="JavaScript"%> <HTML> <BODY> <%=Server.URLEncode("Hello, this string is URL Encoded!")%> <BR><BR> Now let's see a reprint of Script14a.asp. I did not type it manually. Instead, I let Server.CreateObject( ) do all the work.<BR> <STRONG> <% Server.ScriptTimeout=10 var ASPScriptObject = Server.CreateObject("Scripting.FileSystemObject"); var myPath=Server.MapPath("\\") + "\\Section04\\script14a.asp" var AspScript = ASPScriptObject.OpenTextFile(myPath); var outputScript=""; while(!AspScript.AtEndOfStream) { outputScript += AspScript.ReadLine() + "\r"; } outputScript = new String(outputScript); outputScript=Server.HTMLEncode(outputScript) AspScript.Close(); outputScript = "<PRE>" + outputScript + "</PRE>"; Response.Write(outputScript) %> </STRONG> </BODY> </HTML>
Click Here to run the script in a new window.
I demonstrated four methods in the script14.asp. We'll take them from top to bottom.
Explaining the Script:
Server.URLEncode() does exactly what you think it does. It takes a string and encodes it to RFC 1738 standards. That's more than you ever wanted to know about Server.URLEncode(), isn't it?
Next we have Server.CreateObject(). In this case I created an instance of the FileSystem Object. The most common objects that you will instanciate are ADODB.Recordset, Scripting.FileSystemObject, Scripting.Dictionary, MSWC.AdRotator, MSWC.BrowserType, MSWC.NextLink, and MSWC.ContentRotator. There are many good resources on all of these created Objects. Most of them are beyond the scope of this web site.
Next on the list is Server.MapPath(). Looking back at script14.asp, do you see the double slashes (\\) in the MapPath argument? That's not an accident. We have to use escape characters in JavaScript.
The last Method I demonstrate is Server.HTMLEncode(). It converts HTML flags into non-HTML equivalents.
The Lone Property:
Server has one property: ScriptTimeout. It sets the maximum number of seconds allowable for script execution. If the script execution exceeds that time, then it times out. The user gets an ugly message but at least the Web Server can quit executing your darned greedy script and go about other business.
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
RTX 5090要首发 性能要翻倍!三星展示GDDR7显存
三星在GTC上展示了专为下一代游戏GPU设计的GDDR7内存。
首次推出的GDDR7内存模块密度为16GB,每个模块容量为2GB。其速度预设为32 Gbps(PAM3),但也可以降至28 Gbps,以提高产量和初始阶段的整体性能和成本效益。
据三星表示,GDDR7内存的能效将提高20%,同时工作电压仅为1.1V,低于标准的1.2V。通过采用更新的封装材料和优化的电路设计,使得在高速运行时的发热量降低,GDDR7的热阻比GDDR6降低了70%。
更新日志
- 黄安《救姻缘》台首版[WAV+CUE]
- 模拟之声慢刻CD《柏林之声4》[正版CD低速原抓WAV+CUE]
- 李宗盛 《李宗盛经典金曲》[WAV+CUE][1G]
- 周华健《粤语精选》[WAV+CUE][1G]
- 蔡婧2024《天空》HQCDII头版限量编号[WAV+CUE][1G]
- 陈奂仁.2011-谁是陈奂仁【BBS】【FLAC分轨】
- 群星.2024-幻乐森林影视原声带【韶愔音乐】【FLAC分轨】
- 黎明.1999-向往金色的黎明新歌+精选2CD【环球】【WAV+CUE】
- 发烧女声Méav《美芙的祈祷》发烧女声 [WAV+CUE][820M]
- 雷婷 《我的爱回不来》紫银合金AQCD [WAV+CUE][1G]
- 群星 DTS《天籁之音·唱醉了草原》2CD[WAV分轨][1.6G]
- 魔兽世界wlk毁灭术一键输出宏是什么 wlk毁灭术一键输出宏介绍
- 三国志8重制版无法与武将交流怎么办 无法与武将交流解决方法一览
- 三国志8重制版恶名怎么消除 恶名影响与消除方法介绍
- 模拟之声慢刻CD《柏林之声5》2019[原抓WAV+CUE]