推薦:ASP初學(xué)者常用源代碼總結(jié)篇(4)_ASP教程
推薦:ASP編程中15個非常有用的例子1.如何用Asp判斷你的網(wǎng)站的虛擬物理路徑 答:使用Mappath方法 以下為引用的內(nèi)容: <p align="center"><font size="4
16.使用FSO修改文件特定內(nèi)容的函數(shù):
function FSOchange(filename,Target,String)
Dim objFSO,objCountFile,FiletempData
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objCountFile = objFSO.OpenTextFile(Server.MapPath(filename),1,True)
FiletempData = objCountFile.ReadAll
objCountFile.Close
FiletempData=Replace(FiletempData,Target,String)
Set objCountFile=objFSO.CreateTextFile(Server.MapPath(filename),True)
objCountFile.Write FiletempData
objCountFile.Close
Set objCountFile=Nothing
Set objFSO = Nothing
End Function
17.使用FSO讀取文件內(nèi)容的函數(shù):
function FSOFileRead(filename)
Dim objFSO,objCountFile,FiletempData
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objCountFile = objFSO.OpenTextFile(Server.MapPath(filename),1,True)
FSOFileRead = objCountFile.ReadAll
objCountFile.Close
Set objCountFile=Nothing
Set objFSO = Nothing
End Function
18.使用FSO讀取文件某一行的函數(shù):
function FSOlinedit(filename,lineNum)
if linenum < 1 then exit function
dim fso,f,temparray,tempcnt
set fso = server.CreateObject("scripting.filesystemobject")
if not fso.fileExists(server.mappath(filename)) then exit function
set f = fso.opentextfile(server.mappath(filename),1)
if not f.AtEndofStream then
tempcnt = f.readall
f.close
set f = nothing
temparray = split(tempcnt,chr(13)&chr(10))
if lineNum>ubound(temparray) 1 then
exit function
else
FSOlinedit = temparray(lineNum-1)
end if
end if
end function
分享:asp當(dāng)中判斷函數(shù)一覽最新的WEB源碼下載,馬上去看看... 商業(yè)源碼熱門下載www.chinaz.com <1>IsArray 函數(shù) 返回 Boolean 值指明某變量是否為數(shù)組。 語法 IsArray(varname) varname 參數(shù)可以是任意變量
- asp FSO 讀寫文件本文件實現(xiàn)代碼
- asp中isNull、isEmpty和空字符串的區(qū)別
- asp獲取用戶真實IP地址的方法
- asp連接sqlserver數(shù)據(jù)庫實現(xiàn)代碼
- asp中正則表達(dá)式過濾html代碼函數(shù)
- asp中g(shù)et post提交表單區(qū)別
- 網(wǎng)頁模板:ASP內(nèi)建對象Request
- xmlhttp的open方法使用詳解
- ASP的常用的自定義函數(shù)大全
- asp中用for循環(huán)的一個小技巧
- eWebEditor v3.8 列目錄
- ASP無組件分頁實現(xiàn)思路及代碼
- 相關(guān)鏈接:
- 教程說明:
ASP教程-推薦:ASP初學(xué)者常用源代碼總結(jié)篇(4)
。