日韩天天综合网_野战两个奶头被亲到高潮_亚洲日韩欧美精品综合_av女人天堂污污污_视频一区**字幕无弹窗_国产亚洲欧美小视频_国内性爱精品在线免费视频_国产一级电影在线播放_日韩欧美内地福利_亚洲一二三不卡片区

ASP應(yīng)用進階 ASP Error對象的相關(guān)知識(2)_ASP教程

編輯Tag賺U幣
教程Tag:暫無Tag,歡迎添加,賺取U幣!

推薦:實例詳解ASP中斷開記錄集的使用方法
我們在使用ASP 內(nèi)置的ADO組件進行數(shù)據(jù)庫編程時,通常是在腳本的開頭打開一個連接,并在腳本的最后關(guān)閉它,但是就較大腳本而言,在多數(shù)情況下連接打開的時間要比它需要打開的時間長得多。因此為

Column:整型。產(chǎn)生錯誤的文件中的字符位置

Description:字符串型。錯誤的簡短說明

File:字符串型。錯誤出現(xiàn)時正在處理的文件的名稱

Line:整型。產(chǎn)生錯誤的文件中的行號

Number:整型。一個標(biāo)準(zhǔn)的COM錯誤代碼

Source:字符串型。引發(fā)錯誤的行的實際代碼

ok,這就是9個屬性,使用asperror對象的語法是:

asperror.property

就是這樣:ASPError.ASPCode()

ASPError.ASPDescription()

ASPError.Category()

ASPError.Column()

ASPError.Description()

ASPError.File()

ASPError.Line()

ASPError.Number()

ASPError.Source()

在iis支持的所有目錄下面(或:在編輯了錯誤映射屬性的目錄內(nèi))的任一頁面上出現(xiàn)一個與ASP相關(guān)的錯誤時,都將載入定制錯誤頁面。實際上,現(xiàn)在已經(jīng)設(shè)置了一個正常的腳本錯誤陷阱,因為在這個目錄內(nèi)的任何一個網(wǎng)頁上的ASP運行期錯誤都將觸發(fā)定制錯誤頁面,錯誤網(wǎng)頁作為IIS的缺省安裝部分,可根據(jù)個人情況定制.例如,當(dāng)我們在一個目錄下面輸入不存在的網(wǎng)頁時,出現(xiàn)404錯誤,當(dāng)一個404錯誤出現(xiàn)時,使用的頁面是404b.htm,這個文件包含一個客戶端腳本代碼部分,它獲得當(dāng)前文檔的URL(從document對象的url屬性中檢索)并在該頁面中顯示:

<!DOCTYPEHTMLPUBLIC"-//W3C//DTDHTML3.2Final//EN">
<htmldir=ltr>
<head>
<style>a:link{font:9pt/11pt宋體;color:FF0000}a:visited{font:9pt/11pt宋體;color:#4e4e4e}
</style>
<METANAME="ROBOTS"CONTENT="NOINDEX">
<title>無法找到網(wǎng)頁</title>
<METAHTTP-EQUIV="Content-Type"Content="text-html;charset=gb2312">
<METANAME="MS.LOCALE"CONTENT="ZH-CN">
</head>
<script>
functionHomepage(){
<!--
//inrealbits,urlsgetreturnedtoourscriptlikethis:
//res://shdocvw.dll/http_404.htm#http://www.DocURL.com/bar.htm
//FortestinguseDocURL="res://shdocvw.dll/http_404.htm#https://www.microsoft.com/bar.htm"
DocURL=document.URL;
//thisiswherethehttporhttpswillbe,asfoundbysearchingfor://butskippingtheres://
protocolIndex=DocURL.indexOf("://",4);
//thisfindstheendingslashforthedomainserver
serverIndex=DocURL.indexOf("/",protocolIndex 3);
//forthehref,weneedavalidURLtothedomain.Wesearchforthe#symboltofindthebegining
//ofthetrueURL,andadd1toskipit-thisistheBeginURLvalue.WeuseserverIndexastheendmarker.
//urlresult=DocURL.substring(protocolIndex-4,serverIndex);
BeginURL=DocURL.indexOf("#",1) 1;
urlresult=DocURL.substring(BeginURL,serverIndex);
//fordisplay,weneedtoskipafterhttp://,andgotothenextslash
displayresult=DocURL.substring(protocolIndex 3,serverIndex);
InsertElementAnchor(urlresult,displayresult);
}
functionHtmlEncode(text)
{
returntext.replace(/&/g,'&amp').replace(/'/g,'&quot;').replace(/</g,'&lt;').replace(/>/g,'&gt;');
}
functionTagAttrib(name,value)
{
return'' name '="' HtmlEncode(value) '"';
}
functionPrintTag(tagName,needCloseTag,attrib,inner){
document.write('<' tagName attrib '>' HtmlEncode(inner));
if(needCloseTag)document.write('</' tagName '>');
}
functionURI(href)
{
IEVer=window.navigator.appVersion;
IEVer=IEVer.substr(IEVer.indexOf('MSIE') 5,3);
return(IEVer.charAt(1)=='.'&&IEVer>='5.5')?
encodeURI(href):
escape(href).replace(/:/g,':').replace(/;/g,';');
}
functionInsertElementAnchor(href,text)
{
PrintTag('A',true,TagAttrib('HREF',URI(href)),text);
}
//-->
</script>
<bodybgcolor="FFFFFF">
<tablewidth="410"cellpadding="3"cellspacing="5">
 <tr>
<tdalign="left"valign="middle"width="360">
<h1style="COLOR:000000;FONT:12pt/15pt宋體"><!--Problem-->無法找到網(wǎng)頁</h1>
</td>
 </tr>
 <tr>
<tdwidth="400"colspan="2"><fontstyle="COLOR:000000;FONT:9pt/11pt宋體">您正在搜索的網(wǎng)頁可能已經(jīng)刪除、更名或暫時不可用。</font></td>
 </tr>
 <tr>
<tdwidth="400"colspan="2"><fontstyle="COLOR:000000;FONT:9pt/11pt宋體">
<hrcolor="#C0C0C0"noshade>
<p>請嘗試下列操作:</p>
<ul>
<li>如果您在“地址”欄中鍵入了網(wǎng)頁地址,請檢查其拼寫是否正確。<br>
 </li>
<li>打開<script>
 <!--
 if(!((window.navigator.userAgent.indexOf("MSIE")>0)&&(window.navigator.appVersion.charAt(0)=="2")))
 {
 Homepage();
 }
 //-->
 </script>主頁,尋找指向所需信息的鏈接。</li>
<li>單擊<ahref="javascript:history.back(1)">后退</a>按鈕嘗試其他鏈接。</li>
</ul>
<h2style="font:9pt/11pt宋體;color:000000">HTTP404-無法找到文件<br>Internet信息服務(wù)<BR></h2>
<hrcolor="#C0C0C0"noshade>
<p>技術(shù)信息(支持個人)</p>
<ul>
<li>詳細(xì)信息:<br><ahref="http://www.microsoft.com/ContentRedirect.asp?prd=iis&sbp=&pver=5.0&pid=&ID=404&cat=web&os=&over=&hrd=&Opt1=&Opt2=&Opt3="target="_blank">Microsoft支持</a>
</li>
</ul>
</font></td>
 </tr>
</table>
</body>
</html>

分享:請注意!常見的ASP腳本攻擊及防范技巧
由于ASP的方便易用,越來越多的網(wǎng)站后臺程序都使用ASP腳本語言。但是, 由于ASP本身存在一些安全漏洞,稍不小心就會給黑客提供可乘之機。事實上,安全不僅是網(wǎng)管的事,編程人員也必須在某些安全

來源:模板無憂//所屬分類:ASP教程/更新時間:2008-08-22
相關(guān)ASP教程