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

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

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

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


'函數(shù)功能:判斷文件是否存在
'相關參數(shù):FileName
'返回值: 如果存在返回True,否則返回False  
Function Filehaveno(FileName)
set ffso=server.createobject("scripting.filesystemobject")
Filehaveno=ffso.FileExists(server.mappath(filename))
set ffso=nothing
End Function  
'----------------------------------
'函數(shù)功能:把指定的字符串寫到指定新文件中
'相關參數(shù):String(字符串),FileName(文件名)
'返回值:無  
Function WriteString(String,FileName)
if string="" then exit function
if filename="" then exit function
if instr(filename,".")=0 then exit function
set ffso=server.createobject("scripting.filesystemobject")
set wfso=ffso.CreateTextFile(server.mappath(filename))
wfso.Writeline(string)
wfso.close
set ffso=nothing
End Function
'---------------------------------------
'字符個數(shù)統(tǒng)一顯示
'left函數(shù),以英文說明為標準
Function LeftTrue(str,n)
If len(str)<=n/2 Then
LeftTrue=str
Else
Dim TStr
Dim l,t,c
Dim i
l=len(str)
t=l
TStr=""
t=0
for i=1 to l
c=asc(mid(str,i,1))
If c<0 then c=c+65536
If c>255 then
t=t+2
Else
t=t+1
End If
'If t>n Then exit for        '如果要顯示字符
If t>n Then exit for        '如果要顯示漢字
TStr=TStr&(mid(str,i,1))
next
LeftTrue = TStr
End If
End Function
'------------------------------------------
'UTF轉GB---將UTF8編碼文字轉換為GB編碼文字
function UTF2GB(UTFStr)

for Dig=1 to len(UTFStr)
   '如果UTF8編碼文字以%開頭則進行轉換
   if mid(UTFStr,Dig,1)="%" then
      'UTF8編碼文字大于8則轉換為漢字
     if len(UTFStr) >= Dig+8 then
        GBStr=GBStr & ConvChinese(mid(UTFStr,Dig,9))
        Dig=Dig+8
     else
       GBStr=GBStr & mid(UTFStr,Dig,1)
     end if
   else
      GBStr=GBStr & mid(UTFStr,Dig,1)
   end if
next
UTF2GB=GBStr
end function

分享:ASP實現(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

來源:模板無憂//所屬分類:ASP教程/更新時間:2010-04-10
相關ASP教程