欧美日韩精品在线,国内精品久久久久久久久,一级毛片恃级毛片直播,清纯唯美亚洲综合欧美色

常用ASP自定義函數(shù)全集_ASP教程

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

推薦:解讀ASP常見錯誤類型大全
ActiveServerPages,ASP0126(0x80004005)--找不到包含文件 MicrosoftOLEDBProviderforODBCDrivers(0x80040E21)--sql語句出錯(數(shù)據(jù)類型不匹配或表名(字段名)錯誤或表處于編輯狀態(tài),或表不存在于conn打開的數(shù)據(jù)庫中) MicrosoftOLEDBProviderforODBCDrivers(0x800

<%

'========================================================
'函數(shù)導(dǎo)航
'FormatDate(DT,tp) ------------------------------------------日期格式化
'IsInteger(para)   ---------------------------檢測傳遞的參數(shù)是否為數(shù)字型
'ChkrequestDate(Para) -----------------------檢測傳遞的參數(shù)是否為日期型
'ChkPost() ------------------------------------不允許外部提交數(shù)據(jù)的選擇
'IsValidEmail(email)------------------------------------------Email檢測
'MakedownName()--------------------------------構(gòu)造上傳圖片文件名隨機(jī)數(shù)
'getIP() ----------------------------------------------------獲取IP地址
'LeftTrue(str,n)---------------------------------------字符個數(shù)統(tǒng)一顯示
'CheckSql()-為了系統(tǒng)的安全,直接在有數(shù)據(jù)庫連接的地方都加上SQL注入的免疫
'Runtime()---------------------------------------------程序執(zhí)行時(shí)間檢測
'--------------------FSO文件|文件夾操作--------------------------------
'Checkfolder(folderpath)-------------------------------------創(chuàng)建文件夾
'Deletefolder(folderpath) -----------------------------------刪除文件夾
'Filehaveno(FileName) ---------------------------------判斷文件是否存在
'readfilerecord(Filename) -----------將指定的文件內(nèi)容讀出|只能是txt文本
'WriteString(String,FileName)------------把指定的字符串寫到指定新文件中
'--------------------進(jìn)制轉(zhuǎn)化|加密|------------------------------------
'Encrypt(theNumber)| Decrypt(theNumber)   一套加解密ID的函數(shù),最多8位
'UTF2GB(UTFStr) -------------------------將UTF8編碼文字轉(zhuǎn)換為GB編碼文字
'toUTF8(szInput)-------------------------將GB編碼文字轉(zhuǎn)換為UTF8編碼文字
'c10to2(x)-----------------------------------十進(jìn)制代碼轉(zhuǎn)換為二進(jìn)制代碼
'c16to2(x)---------------------------------十六進(jìn)制代碼轉(zhuǎn)換為二進(jìn)制代碼
'c2to16(x)---------------------------------二進(jìn)制代碼轉(zhuǎn)換為十六進(jìn)制代碼
'c2to10(x)-----------------------------------二進(jìn)制代碼轉(zhuǎn)換為十進(jìn)制代碼  
'=========================================================
%>
<%
StartTime=timer()
'日期格式化
Function FormatDate(DT,tp)
dim Y,M,D
Y=Year(DT)
M=month(DT)
D=Day(DT)
if M<10 then M="0"&M
if D<10 then D="0"&D
select case tp
case 1 FormatDate=Y&"年"&M&"月"&D&"日"
case 2 FormatDate=Y&"/"&M&"/"&D
case 3 FormatDate=M&"/"&D
     case 4 FormatDate=Y&"\"&M&"\"&D
case 5 FormatDate=Y&"-"&M&"-"&D
end select
End Function
'--------------------------------
' ---判斷數(shù)據(jù)是否整型 Being-----------------------------
Function IsInteger(para)
dim str
dim l,i
if isNUll(para) then
isInteger=false
exit function
end if
str=cstr(para)
if trim(str)="" then
isInteger=false
exit function
end if
l=len(str)
for i=1 to l
if mid(str,i,1)>"9" or mid(str,i,1)<"0" then
isInteger=false
exit function
end if
next
isInteger=true
if err.number<>0 then err.clear
End Function
'--------------------------------
'檢測傳遞的參數(shù)是否為日期型
Function ChkrequestDate(Para)
ChkrequestDate=False
If Not (IsNull(Para) Or Trim(Para)="" Or Not IsDate(Para)) Then
    ChkrequestDate=True
End If
End Function
'--------------------------------

分享:ASP實(shí)現(xiàn)長文章手動分頁的代碼
% setrecordset1=server.createobject(adodb.recordset) exec=SELECT*FROMnewswhereid=id recordset1.Openexec,conn,1,1 % tablewidth=85%border=0align=centercellpadding=3cellspacing=0 trtd ....... % IfRequest(page)=Then pageNum=0

共6頁上一頁123456下一頁
來源:模板無憂//所屬分類:ASP教程/更新時(shí)間:2010-04-10
相關(guān)ASP教程