name:cnbruce sex:male |
% whichfile=server.mappath("info.txt") Set fso = CreateObject("Scripting.FileSystemObject") Set txt = fso.OpenTextFile(whichfile,1) rline = txt.ReadLine rline = rline "br>" txt.ReadLine Response.Write rline txt.Close %> |
% whichfile=server.mappath("info.txt") Set fso = CreateObject("Scripting.FileSystemObject") Set MyFile = fso.CreateTextFile(whichfile,True) MyFile.WriteLine("My Name Is CN-Bruce") MyFile.WriteLine("My Sex Is Male") MyFile.Close %> a href="opentxt.asp">查看內(nèi)容/a> |
1 |
% whichfile=server.mappath("counter.txt") '打開(kāi)文件并將其值讀取,最后關(guān)閉連接釋放資源 set fso=createobject("Scripting.FileSystemObject") set openfile=fso.opentextfile(whichfile,1) visitors=openfile.readline openfile.close '頁(yè)面顯示記數(shù)內(nèi)容并做加1運(yùn)算 response.write "您是本頁(yè)的第"visitors"位訪客" visitors=visitors+1 '將新的數(shù)值添加寫(xiě)入到文本,最后關(guān)閉所有連接釋放資源 set creatfile=fso.createtextfile(whichfile) creatfile.writeLine(visitors) creatfile.close set fso=nothing %> |
% whichfile=server.mappath("counter.txt") set fso=createobject("Scripting.FileSystemObject") set openfile=fso.opentextfile(whichfile,1) visitors=openfile.readline openfile.close CountLen=len(visitors) response.write "您是本頁(yè)的第" for i=1 to 6-countLen '表示最大值999999 response.write "img src=img/0.gif>/img>" next for i=1 to countlen response.write "img src=img/" mid(visitors,i,1) ".gif>/img>" next response.write "位訪客" visitors=visitors+1 set creatfile=fso.createtextfile(whichfile) creatfile.writeLine(visitors) creatfile.close set fso=nothing %> |
標(biāo)簽:馬鞍山 孝感 湖北 遼陽(yáng) 防城港 四平 平頂山 朝陽(yáng)
巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《ASP編程入門(mén)進(jìn)階(十八):FSO組件之文件操作(上)》,本文關(guān)鍵詞 ASP,編程,入門(mén),進(jìn)階,十八,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問(wèn)題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無(wú)關(guān)。